epiccurious / bitcoin-core-node-builder

Spin up a secure Bitcoin Core node with ease.
Other
3 stars 0 forks source link

Check if binary sha256sum is on PATH #19

Open epiccurious opened 1 year ago

epiccurious commented 1 year ago

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 commented 1 year ago

Marking as a bug not feature due to backwards compatibility.

epiccurious commented 1 year ago
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 commented 1 year ago

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

epiccurious commented 1 year ago

Wait until closing #107 first.

epiccurious commented 1 year ago

Removing from the MVP milestone since this issue affects macOS.