8
8
# if it doesn't, we add it
9
9
if ! git config remote.vscode.url > /dev/null; then
10
10
echo " Could not find 'vscode' as a remote"
11
- echo " Adding with: git remote add -f vscode https://github.com/microsoft/vscode.git &> /dev/null"
12
- echo " Supressing output with '&> /dev/null'"
13
- git remote add -f vscode https://github.com/microsoft/vscode.git & > /dev/null
11
+ echo " Adding with: git remote add vscode https://github.com/microsoft/vscode.git"
12
+ git remote add vscode https://github.com/microsoft/vscode.git
14
13
fi
15
14
16
15
# Ask which version we should update to
@@ -25,7 +24,18 @@ main() {
25
24
exit 1
26
25
fi
27
26
28
- echo -e " Great! We'll prep a PR for updating to $VSCODE_VERSION_TO_UPDATE \n"
27
+ # Check that they have jq installed
28
+ if ! command -v jq & > /dev/null; then
29
+ echo " jq could not be found."
30
+ echo " We use this when looking up the exact version to update to in the package.json in VS Code."
31
+ echo -e " See docs here: https://stedolan.github.io/jq/download/"
32
+ exit
33
+ fi
34
+
35
+ # Grab the exact version from package.json
36
+ VSCODE_EXACT_VERSION=$( curl -s " https://raw.githubusercontent.com/microsoft/vscode/release/$VSCODE_VERSION_TO_UPDATE /package.json" | jq -r " .version" )
37
+
38
+ echo -e " Great! We'll prep a PR for updating to $VSCODE_EXACT_VERSION \n"
29
39
30
40
# Check if GitHub CLI is installed
31
41
if ! command -v gh & > /dev/null; then
@@ -47,7 +57,7 @@ main() {
47
57
48
58
echo " Opening a draft PR on GitHub"
49
59
# To read about these flags, visit the docs: https://cli.github.com/manual/gh_pr_create
50
- gh pr create --base master --title " feat(vscode): update to version $VSCODE_VERSION_TO_UPDATE " --body " This PR updates vscode to version: $VSCODE_VERSION_TO_UPDATE " --reviewer @cdr/code-server-reviewers --repo cdr/code-server --draft
60
+ gh pr create --base master --title " feat(vscode): update to version $VSCODE_EXACT_VERSION " --body " This PR updates vscode to version: $VSCODE_EXACT_VERSION " --reviewer @cdr/code-server-reviewers --repo cdr/code-server --draft
51
61
52
62
echo " Going to try to update vscode for you..."
53
63
echo -e " Running: git subtree pull --prefix lib/vscode vscode release/${VSCODE_VERSION_TO_UPDATE} --squash\n"
0 commit comments