Skip to content

Commit 346378a

Browse files
authored
Merge pull request #229 from per1234/print-resolved-url
Show resolved URL in duplicate submission error message when relevant
2 parents f0f86fc + bbe9570 commit 346378a

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed

main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,12 @@ func populateSubmission(submissionURL string, listPath *paths.Path, accessList [
390390

391391
normalizedListURLObject := normalizeURL(listURLObject)
392392
if normalizedListURLObject.String() == normalizedURLObject.String() {
393-
submission.Error = "Submission URL is already in the Library Manager index."
393+
normalizedSubmissionURLObject := normalizeURL(submissionURLObject)
394+
if normalizedURLObject.String() == normalizedSubmissionURLObject.String() {
395+
submission.Error = "Submission URL is already in the Library Manager index."
396+
} else {
397+
submission.Error = fmt.Sprintf("Resolved URL %s is already in the Library Manager index.", normalizedURLObject.String())
398+
}
394399
return submission, "", true
395400
}
396401
}

tests/test_all.py

+21
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,27 @@
253253
"",
254254
"http://downloads.arduino.cc/libraries/logs/github.com/arduino-libraries/Servo/",
255255
),
256+
(
257+
"resolved-already-in-library-manager",
258+
"FooUser",
259+
"",
260+
"submission",
261+
"",
262+
[
263+
{
264+
"submissionURL": "https://github.com/arduino-org/WiFi_for_UNOWiFi_rev1",
265+
"normalizedURL": "https://github.com/arduino-libraries/WiFi_for_UNOWiFi_rev1.git",
266+
"repositoryName": "WiFi_for_UNOWiFi_rev1",
267+
"name": "",
268+
"official": False,
269+
"tag": "",
270+
"error": "Resolved URL https://github.com/arduino-libraries/WiFi_for_UNOWiFi_rev1.git is already in"
271+
" the Library Manager index.",
272+
}
273+
],
274+
"",
275+
"http://downloads.arduino.cc/libraries/logs/github.com/arduino-libraries/WiFi_for_UNOWiFi_rev1/",
276+
),
256277
(
257278
"type-arduino",
258279
"FooUser",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
diff --git a/repositories.txt b/repositories.txt
2+
index c080a7a..1194257 100644
3+
--- a/repositories.txt
4+
+++ b/repositories.txt
5+
@@ -1,2 +1,3 @@
6+
+https://github.com/arduino-org/WiFi_for_UNOWiFi_rev1
7+
https://github.com/arduino-libraries/WiFi_for_UNOWiFi_rev1
8+
https://github.com/arduino-libraries/Stepper
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://github.com/arduino-libraries/WiFi_for_UNOWiFi_rev1
2+
https://github.com/arduino-libraries/Stepper

0 commit comments

Comments
 (0)