1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-14 15:47:17 +00:00

Make aliasing nicer in oneliner SHA updater

This commit is contained in:
Kristóf Tóth 2018-04-06 10:09:58 +02:00
parent 59810a194e
commit 740110e8c5

View File

@ -1,11 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [ "$(uname)" == "Darwin" ]; then set -eo pipefail
readlink_cmd="greadlink" shopt -s expand_aliases
sed_cmd="gsed"
else
readlink_cmd="readlink"
sed_cmd="sed"
fi
SCRIPT_DIR="$(dirname $($readlink_cmd -f $0))"
$sed_cmd -i "s/SHA=\w\+/SHA=$(sha256sum hack/bootstrap_tfw_dev.sh | cut -d ' ' -f1)/g" "${SCRIPT_DIR}/oneline_install.sh" if [ "$(uname)" == "Darwin" ]; then
alias readlink="greadlink"
alias sed="gsed"
fi
SCRIPT_DIR="$(dirname $(readlink -f $0))"
sed -i "s/SHA=\w\+/SHA=$(sha256sum hack/bootstrap_tfw_dev.sh | cut -d ' ' -f1)/g" "${SCRIPT_DIR}/oneline_install.sh"