Browse Source

fix: use correct directory to generate new version [skip ci]

Baptiste Augrain 2 years ago
parent
commit
272566cc25
1 changed files with 5 additions and 5 deletions
  1. 5 5
      update_version.sh

+ 5 - 5
update_version.sh

@@ -91,8 +91,8 @@ updateLatestVersion() {
   echo "Updating ${VERSION_PATH}/latest.json"
 
   # do not update the same version
-  if [[ -f "versions/${VERSION_PATH}/latest.json" ]]; then
-    CURRENT_VERSION=$( jq -r '.name' "versions/${VERSION_PATH}/latest.json" )
+  if [[ -f "${REPOSITORY_NAME}/${VERSION_PATH}/latest.json" ]]; then
+    CURRENT_VERSION=$( jq -r '.name' "${REPOSITORY_NAME}/${VERSION_PATH}/latest.json" )
     echo "CURRENT_VERSION: ${CURRENT_VERSION}"
 
     if [[ "${CURRENT_VERSION}" == "${RELEASE_VERSION}" && "${FORCE_UPDATE}" != "true" ]]; then
@@ -102,11 +102,11 @@ updateLatestVersion() {
 
   echo "Generating ${VERSION_PATH}/latest.json"
 
-  mkdir -p "versions/${VERSION_PATH}"
+  mkdir -p "${REPOSITORY_NAME}/${VERSION_PATH}"
 
   generateJson
 
-  echo "${JSON_DATA}" > "versions/${VERSION_PATH}/latest.json"
+  echo "${JSON_DATA}" > "${REPOSITORY_NAME}/${VERSION_PATH}/latest.json"
 
   echo "${JSON_DATA}"
 }
@@ -169,7 +169,7 @@ git add .
 CHANGES=$( git status --porcelain )
 
 if [[ ! -z "${CHANGES}" ]]; then
-  echo "${CHANGES}"
+  echo "Some changes have been found, pushing them"
 
   dateAndMonth=$( date "+%D %T" )