From 740110e8c54a7b92433be1309211e9db1f9367ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 6 Apr 2018 10:09:58 +0200 Subject: [PATCH] Make aliasing nicer in oneliner SHA updater --- hack/update_oneline_install.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hack/update_oneline_install.sh b/hack/update_oneline_install.sh index 90bc49e..f2a4bb3 100755 --- a/hack/update_oneline_install.sh +++ b/hack/update_oneline_install.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -if [ "$(uname)" == "Darwin" ]; then - readlink_cmd="greadlink" - sed_cmd="gsed" -else - readlink_cmd="readlink" - sed_cmd="sed" -fi -SCRIPT_DIR="$(dirname $($readlink_cmd -f $0))" +set -eo pipefail +shopt -s expand_aliases -$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"