소스 검색

fix: use blank commit id

Baptiste Augrain 1 년 전
부모
커밋
d6b7880a05
1개의 변경된 파일9개의 추가작업 그리고 9개의 파일을 삭제
  1. 9 9
      get_repo.sh

+ 9 - 9
get_repo.sh

@@ -10,13 +10,13 @@ fi
 if [[ -z "${RELEASE_VERSION}" ]]; then
   if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
     if [[ "${VSCODE_LATEST}" == "yes" ]] || [[ ! -f "insider.json" ]]; then
-      UPDATE_INFO=$( curl --silent https://update.code.visualstudio.com/api/update/darwin/insider/lol )
+      UPDATE_INFO=$( curl --silent --fail https://update.code.visualstudio.com/api/update/darwin/insider/0000000000000000000000000000000000000000 )
     else
       export MS_COMMIT=$(jq -r '.commit' insider.json)
       export MS_TAG=$(jq -r '.tag' insider.json)
     fi
   else
-    UPDATE_INFO=$( curl --silent https://update.code.visualstudio.com/api/update/darwin/stable/lol )
+    UPDATE_INFO=$( curl --silent --fail https://update.code.visualstudio.com/api/update/darwin/stable/0000000000000000000000000000000000000000 )
   fi
 
   if [[ -z "${MS_COMMIT}" ]]; then
@@ -41,14 +41,14 @@ else
     then
       MS_TAG="${BASH_REMATCH[1]}"
     else
-      echo "Bad RELEASE_VERSION: ${RELEASE_VERSION}"
+      echo "Error: Bad RELEASE_VERSION: ${RELEASE_VERSION}"
       exit 1
     fi
 
     if [[ "${MS_TAG}" == "$(jq -r '.tag' insider.json)" ]]; then
       export MS_COMMIT=$(jq -r '.commit' insider.json)
     else
-      echo "No MS_COMMIT for ${RELEASE_VERSION}"
+      echo "Error: No MS_COMMIT for ${RELEASE_VERSION}"
       exit 1
     fi
   else
@@ -56,7 +56,7 @@ else
     then
       MS_TAG="${BASH_REMATCH[1]}"
     else
-      echo "Bad RELEASE_VERSION: ${RELEASE_VERSION}"
+      echo "Error: Bad RELEASE_VERSION: ${RELEASE_VERSION}"
       exit 1
     fi
   fi
@@ -73,9 +73,9 @@ git remote add origin https://github.com/Microsoft/vscode.git
 # figure out latest tag by calling MS update API
 if [[ -z "${MS_TAG}" ]]; then
   if [[ "${VSCODE_QUALITY}" == "insider" ]]; then
-    UPDATE_INFO=$( curl --silent https://update.code.visualstudio.com/api/update/darwin/insider/lol )
+    UPDATE_INFO=$( curl --silent --fail https://update.code.visualstudio.com/api/update/darwin/insider/0000000000000000000000000000000000000000 )
   else
-    UPDATE_INFO=$( curl --silent https://update.code.visualstudio.com/api/update/darwin/stable/lol )
+    UPDATE_INFO=$( curl --silent --fail https://update.code.visualstudio.com/api/update/darwin/stable/0000000000000000000000000000000000000000 )
   fi
   export MS_COMMIT=$( echo "${UPDATE_INFO}" | jq -r '.version' )
   export MS_TAG=$( echo "${UPDATE_INFO}" | jq -r '.name' )
@@ -83,13 +83,13 @@ elif [[ -z "${MS_COMMIT}" ]]; then
   REFERENCE=$( git ls-remote --tags | grep -x ".*refs\/tags\/${MS_TAG}" | head -1 )
 
   if [[ -z "${REFERENCE}" ]]; then
-    echo "The following tag can't be found: ${MS_TAG}"
+    echo "Error: The following tag can't be found: ${MS_TAG}"
     exit 1
   elif [[ "${REFERENCE}" =~ ^([[:alnum:]]+)[[:space:]]+refs\/tags\/([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
     export MS_COMMIT="${BASH_REMATCH[1]}"
     export MS_TAG="${BASH_REMATCH[2]}"
   else
-    echo "The following reference can't be parsed: ${REFERENCE}"
+    echo "Error: The following reference can't be parsed: ${REFERENCE}"
     exit 1
   fi
 fi