Skip to content
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

Check if binary sha256sum is on PATH #19

Open
epiccurious opened this issue Jun 11, 2023 · 5 comments
Open

Check if binary sha256sum is on PATH #19

epiccurious opened this issue Jun 11, 2023 · 5 comments
Assignees
Labels
BUG Something isn't working EASY Good for newcomers

Comments

@epiccurious
Copy link
Owner

epiccurious commented Jun 11, 2023

If sha256sum exists, use sha256sum.

If shasum exists, use shasum -a 256.

If neither exists, exit 1 from the script.

https://github.com/babashka/babashka/pull/1108/files#diff-1e142e6277b12b7e1110478a24caee8f006a9349e86970c890203d6266209463R116-124

@epiccurious epiccurious changed the title Check if sha256 is on PATH Check if binary sha256sum is on PATH Jun 11, 2023
@epiccurious epiccurious added this to the Minimum Viable Product milestone Jun 11, 2023
@epiccurious epiccurious added BUG Something isn't working EASY Good for newcomers labels Jun 11, 2023
@epiccurious epiccurious self-assigned this Jun 11, 2023
@epiccurious
Copy link
Owner Author

Marking as a bug not feature due to backwards compatibility.

@epiccurious
Copy link
Owner Author

if command -v sha256sum >/dev/null; then
   sha256sum_cmd="sha256sum"
elif command -v shasum >/dev/null; then
   sha256sum_cmd="shasum -a 256"
else
   >&2 echo "Either 'sha256sum' or 'shasum' must on PATH."
   >&2 echo "Exiting..."
   exit 1
fi

@epiccurious
Copy link
Owner Author

This issue also relates to #96, since macOS includes shasum but not sha256sum.

@epiccurious
Copy link
Owner Author

Wait until closing #107 first.

@epiccurious
Copy link
Owner Author

Removing from the MVP milestone since this issue affects macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working EASY Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant