From 974619f5d8c0c1a36169299d268fa1837709b170 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Sun, 2 Apr 2023 15:55:31 +0200 Subject: [PATCH] fix: get dirname from repository [skip ci] --- update_version.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/update_version.sh b/update_version.sh index 04fb027..6028c07 100755 --- a/update_version.sh +++ b/update_version.sh @@ -40,6 +40,7 @@ fi # `timestamp` is $(node -e 'console.log(Date.now())') # `sha256hash` in .sha256 +REPOSITORY_NAME="${VERSIONS_REPOSITORY/*\//}" URL_BASE="https://github.com/${ASSETS_REPOSITORY}/releases/download/${RELEASE_VERSION}" generateJson() { @@ -103,7 +104,7 @@ updateLatestVersion() { # init versions repo for later commiting + pushing the json file to it # thank you https://www.vinaygopinath.me/blog/tech/commit-to-master-branch-on-github-using-travis-ci/ git clone "https://github.com/${VERSIONS_REPOSITORY}.git" -cd versions +cd "${REPOSITORY_NAME}" || { echo "'${REPOSITORY_NAME}' dir not found"; exit 1; } git config user.email "$( echo "${GITHUB_USERNAME}" | awk '{print tolower($0)}' )-ci@not-real.com" git config user.name "${GITHUB_USERNAME} CI" git remote rm origin @@ -150,7 +151,7 @@ else # linux updateLatestVersion fi -cd versions +cd "${REPOSITORY_NAME}" || { echo "'${REPOSITORY_NAME}' dir not found"; exit 1; } git pull origin master # in case another build just pushed git add .