macOS fix, improvements

pull/58/head v2.3.4
Simon Let 6 years ago
parent d9ffd1d193
commit ce2bce1580
  1. 18
      scripts/install.sh
  2. 6
      scripts/rawinstall.sh

@ -2,21 +2,6 @@
set -euo pipefail set -euo pipefail
die() {
if [ $# -eq 1 ]; then
echo "$1"
elif [ $# -eq 0 ]; then
echo "ERROR: SomEtHiNg WeNt wRonG - ExItiNg!"
echo "THIS IS NOT SUPPOSED TO HAPPEN!"
fi
echo
echo "Please report any issues you encounter to: https://github.com/curusarn/resh/issues"
echo
echo "You can rerun this installation by executing: (you will skip downloading the files)"
echo "cd $PWD && scripts/install.sh"
exit 1
}
echo echo
echo "Checking your system ..." echo "Checking your system ..."
@ -24,7 +9,8 @@ echo "Checking your system ..."
login_shell=$(echo "$SHELL" | rev | cut -d'/' -f1 | rev) login_shell=$(echo "$SHELL" | rev | cut -d'/' -f1 | rev)
if [ "$login_shell" != bash ] && [ "$login_shell" != zsh ]; then if [ "$login_shell" != bash ] && [ "$login_shell" != zsh ]; then
die "ERROR: Unsupported/unknown login shell: $login_shell" echo "ERROR: Unsupported/unknown login shell: $login_shell"
exit 1
fi fi
echo " * Login shell: $login_shell - OK" echo " * Login shell: $login_shell - OK"

@ -80,6 +80,12 @@ curl $curl_opt "$dl_binaries"
echo echo
echo "Checking integrity ..." echo "Checking integrity ..."
# macOS doesn't have sha256sum
if [ "$OS" = darwin ]; then
function sha256sum() { shasum -a 256 "$@" ; } && export -f sha256sum
fi
if [ "$(sha256sum "$fname_binaries")" != "$(grep "$fname_binaries" "$fname_checksums")" ]; then if [ "$(sha256sum "$fname_binaries")" != "$(grep "$fname_binaries" "$fname_checksums")" ]; then
echo "ERROR: integrity check failed - exiting!" echo "ERROR: integrity check failed - exiting!"
exit 1 exit 1

Loading…
Cancel
Save