diff --git a/scripts/update-status-go.sh b/scripts/update-status-go.sh index 8242dbf23d..aa5e055871 100755 --- a/scripts/update-status-go.sh +++ b/scripts/update-status-go.sh @@ -1,31 +1,30 @@ #!/usr/bin/env bash -if [[ ! -x "$(command -v nix-prefetch-url)" ]] && [[ -z "${IN_NIX_SHELL}" ]]; then - echo "Remember to call 'make shell'!" +GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel) +source "${GIT_ROOT}/nix/scripts/source.sh" + +if [[ ! -x "$(command -v nix-prefetch-url)" ]]; then + echo "No 'nix-prefetch-url' utility found!" >&2 exit 1 fi set -ef +# urlencode urlencode() { - # urlencode - - old_lc_collate=$LC_COLLATE - LC_COLLATE=C - - local length="${#1}" - for (( i = 0; i < length; i++ )); do - local c="${1:$i:1}" - case $c in - [a-zA-Z0-9.~_-]) printf '%s' "$c" ;; - *) printf '%%%02X' "'$c" ;; + old_lc_collate=$LC_COLLATE + LC_COLLATE=C + local length="${#1}" + for (( i = 0; i < length; i++ )); do + local c="${1:$i:1}" + case $c in + [a-zA-Z0-9.~_-]) printf '%s' "$c";; + *) printf '%%%02X' "'$c";; esac done - LC_COLLATE=$old_lc_collate } -GIT_ROOT="$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)" VERSION_FILE="${GIT_ROOT}/status-go-version.json" SCRIPT_FILE="$(basename "$0")" @@ -97,7 +96,8 @@ STATUS_GO_SHA256=$(nix-prefetch-url --unpack ${REPO_URL}/archive/$(urlencode ${S cat << EOF > ${VERSION_FILE} { - "_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh ' instead", + "_comment": "THIS SHOULD NOT BE EDITED BY HAND.", + "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "${STATUS_GO_OWNER}", "repo": "${STATUS_GO_REPO}", "version": "${STATUS_GO_VERSION}", diff --git a/status-go-version.json b/status-go-version.json index 135c1aa221..8f4a9d8211 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -1,5 +1,6 @@ { - "_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh ' instead", + "_comment": "THIS SHOULD NOT BE EDITTED BY HAND.", + "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", "version": "v0.86.3",