.github/scripts/replace-asset.sh: fixed a fail

Fixed premature end when GITHUB_REPOSITORY/GITHUB_TOKEN were not given.
This commit is contained in:
Martin Pulec
2020-05-29 13:31:24 +02:00
parent 6c82e4c036
commit d01e467070

View File

@@ -1,6 +1,7 @@
#!/bin/sh -eux
# If first parameter is GITHUB_TOKEN=<tok>, use <tok> as an env var GITHUB_TOKEN (used by the scripts below)
set +e # pattern matching may fail
# If first parameter 2 parameters is GITHUB_REPOSOTIRY and GITHUB_TOKEN, those willbe used as an env var (used by the scripts below)
REPOSITORY=$(expr $1 : "GITHUB_REPOSITORY=\(.*\)")
if [ $? -eq 0 ]; then
export GITHUB_REPOSITORY=$REPOSITORY
@@ -11,6 +12,7 @@ if [ $? -eq 0 ]; then
export GITHUB_TOKEN=$TOKEN
shift
fi
set -e
DIR=$(dirname $0)