-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install script fixes for better Mac support #1194
Install script fixes for better Mac support #1194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR @HudsonOnHere 👍🏻
However I don't think that's a great way of handling this. Verifying checksum is optional and sha256sum could be missing on other platforms too (assuming this script can evolve at any time to support more platforms). Instead, I would suggest we simply skip checksum verification and display a warning message such as "WARNING: checksum verification was skipped because sha256sum is not installed."
EDIT: another solution could be to check whever sha256sum or shasum is installed and use one of them, without checking the platform. If none is installed, exit with error.
WDYT?
Eventually, this PR could fix #1202 as well. I think we can drop usage of wget and use curl for all requests. |
@sundowndev Thanks for your feedback -- I like your idea about checking for which shasum is installed, I did not realize that the intention was for this validation to be optional, so I will update the code so that it does not fail if the validation does not succeed.
I can also update the code to use EDIT: I just spent some time on the two items above and I think I have a good idea of how to accomplish both of these. I'll have an updated PR soon. |
@HudsonOnHere Thanks for following up! On a second thought, let's perform the check on which program is available and then still exit with error when the verification fails. However, we can display a warning message if neither sha256sum or shasum is installed. |
Sounds good to me -- I should have some updates in the next day or two. |
…ptional arguments, a path to manual download if the automatic checks fail, and fallbacks to curl if wget is not installed.
@sundowndev I think this update should address all of our concerns. Sorry for the amount of changes introduced, but I thought it would be best to refactor the code so that we could handle everything better and make it more robust. Here's what changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're almost good.
Remaining changes:
- Fix the user input not working on manual mode
- Fix issues highlighted by shellcheck
…f =~ to match as a regex rather than literally.
1. SC2155 (warning): Declare and assign separately to avoid masking return values. 2. SC2061 (warning): Quote the parameter to -name so the shell won't interpret it.
@sundowndev Please see my comment on our thread above, the solution is to fetch the script using a different command
These issues have been corrected |
Merge branch 'master' into feat/install-script-mac-support
Sorry I must be missing it, I don't see anything |
@HudsonOnHere Sorry it was a mistake on my end. |
Trying to install on Mac and encountered a bug. At line 18, sha256sum was throwing an error because that command has a different syntax on Macs.
Verifiying checksum...
Error: ./support/scripts/install: line 18: sha256sum: command not found
Fixed this by adding additional logic for checksum validation if
uname -s
returns "Darwin"Created an array for supported system types, for better readability and future extensibility.