From f4d85d1e3a56e932b8b548635f6fbde2eccd8cba Mon Sep 17 00:00:00 2001 From: Akash Satheesan Date: Wed, 14 Apr 2021 16:22:54 +0530 Subject: [PATCH] fix(update-vscode): add check/docs for git-subtree --- ci/dev/update-vscode.sh | 14 +++++++++++++- docs/CONTRIBUTING.md | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ci/dev/update-vscode.sh b/ci/dev/update-vscode.sh index 65daedcc3a0e..1b60d57c2df5 100755 --- a/ci/dev/update-vscode.sh +++ b/ci/dev/update-vscode.sh @@ -56,8 +56,20 @@ main() { echo "jq could not be found." echo "We use this when looking up the exact version to update to in the package.json in VS Code." echo -e "See docs here: https://stedolan.github.io/jq/download/" - exit + exit 1 + fi + + # Note: `git subtree` returns 129 when installed, and prints help; + # but when uninstalled, returns 1. + set +e + git subtree &>/dev/null + if [ $? -ne 129 ]; then + echo "git-subtree could not be found." + echo "We use this to fetch and update the lib/vscode subtree." + echo -e "Please install git subtree." + exit 1 fi + set -e # Grab the exact version from package.json VSCODE_EXACT_VERSION=$(curl -s "https://raw.githubusercontent.com/microsoft/vscode/release/$VSCODE_VERSION_TO_UPDATE/package.json" | jq -r ".version") diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 15c997fd64b5..d909521694fd 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -59,6 +59,9 @@ To develop inside an isolated Docker container: ### Updating VS Code +Updating VS Code requires `git subtree`. On some rpm-based Linux distros, `git subtree` is not included by default, and needs to be installed separately. +To install, run `dnf install git-subtree` or `yum install git-subtree` as necessary. + To update VS Code, follow these steps: 1. Run `yarn update:vscode`.