From 15260f48019c1ddffd7d39b3b968af5c3a47835f Mon Sep 17 00:00:00 2001 From: Peter Squicciarini Date: Wed, 16 Sep 2020 11:18:02 -0700 Subject: [PATCH] (experiment) don't download full repo --- get_repo.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/get_repo.sh b/get_repo.sh index d859e01..0337fe6 100755 --- a/get_repo.sh +++ b/get_repo.sh @@ -1,15 +1,10 @@ #!/bin/bash -if [ -d vscode ]; then - cd vscode - git fetch --all -else - git clone https://github.com/Microsoft/vscode.git - cd vscode -fi - -export LATEST_MS_COMMIT=$(git rev-list --tags --max-count=1) -export LATEST_MS_TAG=$(git describe --tags ${LATEST_MS_COMMIT}) +# figure out latest tag by calling MS update API +UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/stable/lol) +export LATEST_MS_COMMIT=$(echo $UPDATE_INFO | jq '.version') +export LATEST_MS_TAG=$(echo $UPDATE_INFO | jq '.name') echo "Got the latest MS tag: ${LATEST_MS_TAG}" -git checkout $LATEST_MS_TAG -cd .. + +git clone https://github.com/Microsoft/vscode.git --branch $LATEST_MS_TAG --depth 1 +