dan-snelson / dialog-scripts

Scripts with leverage Bart Reardon's swiftDialog
MIT License
110 stars 35 forks source link

swiftDialog Installation Fails #57

Closed hooleahn closed 4 weeks ago

hooleahn commented 5 months ago

Before submitting a Setup Your Mac bug report, please review the open swiftDialog issues to help determine the source of the issue.

Describe the bug https://github.com/dan-snelson/dialog-scripts/blob/934e13a1d504cf215d45677144decdec8a0d3152/Setup%20Your%20Mac/Setup-Your-Mac-via-Dialog.bash#L227

When swiftDialog is not installed this line is failing because there's a redirection not being followed. This is what is returned:

{
  "message": "Moved Permanently",
  "url": "https://api.github.com/repositories/346831918/releases/latest",
  "documentation_url": "https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api#follow-redirects"
}

To Reproduce Run curl "https://api.github.com/repos/bartreardon/swiftDialog/releases/latest" without the silent and fail flags.

Expected behavior Adding the --L flag to follow the redirect fixes the issue:

curl -L --silent --fail "https://api.github.com/repos/bartreardon/swiftDialog/releases/latest" | awk -F '"' "/browser_download_url/ && /pkg\"/ { print \$4; exit }"

dan-snelson commented 4 weeks ago

https://github.com/setup-your-mac/Setup-Your-Mac/blob/main/Setup-Your-Mac-via-Dialog.bash#L1719