Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ func main() {
}

// Assemble the index entry for the submissions.
// Note: %0A must be used for line breaks in all strings that will be used as step/job outputs in the GitHub Actions
// workflow. In that application, any text following \n is discarded.
req.IndexEntry = strings.Join(indexEntries, "%0A")

// Assemble the list of Library Manager indexer logs URLs for the submissions to show in the acceptance message.
Expand Down Expand Up @@ -260,7 +262,7 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT

// Check if URL is from a supported Git host.
if !uRLIsUnder(normalizedURLObject, supportedHosts) {
submission.Error = normalizedURLObject.Host + " is not currently supported as a Git hosting website for Library Manager.%0ASee: https://github.com/arduino/library-registry/blob/main/FAQ.md#what-are-the-requirements-for-a-library-to-be-added-to-library-manager"
submission.Error = fmt.Sprintf("`%s` is not currently supported as a Git hosting website for Library Manager.%%0A%%0ASee: https://github.com/arduino/library-registry/blob/main/FAQ.md#what-are-the-requirements-for-a-library-to-be-added-to-library-manager", normalizedURLObject.Host)
return submission, ""
}

Expand Down Expand Up @@ -350,18 +352,18 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT
// Get submission library name. It is necessary to record this in the index source entry because the library is locked to this name.
libraryPropertiesPath := submissionClonePath.Join("library.properties")
if !libraryPropertiesPath.Exist() {
submission.Error = "Library is missing a library.properties metadata file."
submission.Error = "Library is missing a library.properties metadata file.%0A%0ASee: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata"
return submission, ""
}
libraryProperties, err := properties.LoadFromPath(libraryPropertiesPath)
if err != nil {
submission.Error = fmt.Sprintf("Invalid library.properties file (%s)", err)
submission.Error = fmt.Sprintf("Invalid library.properties file: %s%%0A%%0ASee: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata", err)
return submission, ""
}
var ok bool
submission.Name, ok = libraryProperties.GetOk("name")
if !ok {
submission.Error = "library.properties is missing a name field"
submission.Error = "library.properties is missing a name field.%0A%0ASee: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata"
return submission, ""
}

Expand Down
9 changes: 5 additions & 4 deletions test/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@
"name": "",
"official": False,
"tag": "",
"error": "example.com is not currently supported as a Git hosting website for Library Manager.%0A"
"See: https://github.com/arduino/library-registry/blob/main/FAQ.md#what-are-the-requirements-for-a-"
"library-to-be-added-to-library-manager",
"error": "`example.com` is not currently supported as a Git hosting website for Library Manager.%0A"
"%0ASee: https://github.com/arduino/library-registry/blob/main/FAQ.md#what-are-the-requirements-for"
"-a-library-to-be-added-to-library-manager",
}
],
"",
Expand Down Expand Up @@ -232,7 +232,8 @@
"name": "",
"official": True,
"tag": "1.0.1",
"error": "Library is missing a library.properties metadata file.",
"error": "Library is missing a library.properties metadata file.%0A%0A"
"See: https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata",
}
],
"",
Expand Down