Selaa lähdekoodia

fix: get dirname from repository [skip ci]

Baptiste Augrain 2 vuotta sitten
vanhempi
sitoutus
974619f5d8
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 3 2
      update_version.sh

+ 3 - 2
update_version.sh

@@ -40,6 +40,7 @@ fi
 # `timestamp` is $(node -e 'console.log(Date.now())')
 # `timestamp` is $(node -e 'console.log(Date.now())')
 # `sha256hash` in <filename>.sha256
 # `sha256hash` in <filename>.sha256
 
 
+REPOSITORY_NAME="${VERSIONS_REPOSITORY/*\//}"
 URL_BASE="https://github.com/${ASSETS_REPOSITORY}/releases/download/${RELEASE_VERSION}"
 URL_BASE="https://github.com/${ASSETS_REPOSITORY}/releases/download/${RELEASE_VERSION}"
 
 
 generateJson() {
 generateJson() {
@@ -103,7 +104,7 @@ updateLatestVersion() {
 # init versions repo for later commiting + pushing the json file to it
 # 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/
 # 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"
 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.email "$( echo "${GITHUB_USERNAME}" | awk '{print tolower($0)}' )-ci@not-real.com"
 git config user.name "${GITHUB_USERNAME} CI"
 git config user.name "${GITHUB_USERNAME} CI"
 git remote rm origin
 git remote rm origin
@@ -150,7 +151,7 @@ else # linux
   updateLatestVersion
   updateLatestVersion
 fi
 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 pull origin master # in case another build just pushed
 git add .
 git add .