update-status-go: does not need to depend on make shell

The dependency on `make shell` is confusing and unnecessary since
`update-status-go.sh` script only requires availability of the
`nix-prefetch-url` utility to check SHA256 of the `status-go` verison.

Use of `make shell` with this script can also cause issues when running
`make run-android` if already in the shell, which prevents spawning a
new one and effectively stops changes to `status-go-verison.json` file
taking effect.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-09-14 22:16:42 +02:00
parent 4f4651baac
commit a76e4666de
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 18 additions and 17 deletions

View File

@ -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 <string>
urlencode() {
# urlencode <string>
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 <tag>' instead",
"_comment": "THIS SHOULD NOT BE EDITED BY HAND.",
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "${STATUS_GO_OWNER}",
"repo": "${STATUS_GO_REPO}",
"version": "${STATUS_GO_VERSION}",

View File

@ -1,5 +1,6 @@
{
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
"_comment": "THIS SHOULD NOT BE EDITTED BY HAND.",
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.86.3",