|  | 
| 1 | 1 | #!/usr/bin/env bash | 
|  | 2 | +# Description: This is a script to make the process of updating vscode versions easier | 
|  | 3 | +# Run it with `yarn update:vscode` and it will do the following: | 
|  | 4 | +# 1. Check that you have a remote called `vscode` | 
|  | 5 | +# 2. Ask you which version you want to upgrade to | 
|  | 6 | +# 3. Grab the exact version from the package.json i.e. 1.53.2 | 
|  | 7 | +# 4. Fetch the vscode remote branches to run the subtree update | 
|  | 8 | +# 5. Run the subtree update and pull in the vscode update | 
|  | 9 | +# 6. Commit the changes (including merge conflicts) | 
|  | 10 | +# 7. Open a draft PR | 
|  | 11 | + | 
| 2 | 12 | set -euo pipefail | 
| 3 | 13 | 
 | 
| 4 | 14 | # This function expects two arguments | 
| 5 | 15 | # 1. the vscode version we're updating to | 
| 6 | 16 | # 2. the list of merge conflict files | 
| 7 |  | -make_pr_body(){ | 
|  | 17 | +make_pr_body() { | 
| 8 | 18 |   local BODY="This PR updates vscode to $1 | 
| 9 | 19 | 
 | 
| 10 | 20 | ## TODOS | 
| @@ -88,13 +98,12 @@ main() { | 
| 88 | 98 |   # Get the files with conflicts before we commit them | 
| 89 | 99 |   # so we can list them in the PR body | 
| 90 | 100 |   CONFLICTS=$(git diff --name-only --diff-filter=U | while read line; do echo "- $line"; done) | 
|  | 101 | +  PR_BODY=$(make_pr_body "$VSCODE_EXACT_VERSION" "$CONFLICTS") | 
| 91 | 102 | 
 | 
| 92 |  | -  PR_BODY=$(make_pr_body $VSCODE_EXACT_VERSION $CONFLICTS) | 
| 93 |  | -
 | 
| 94 |  | -  echo "Forcing a commit with conflicts" | 
|  | 103 | +  echo -e "\nForcing a commit with conflicts" | 
| 95 | 104 |   echo "Note: this is intentional" | 
| 96 | 105 |   echo "If we don't do this, code review is impossible." | 
| 97 |  | -  echo "For more info, see docs: docs/CONTRIBUTING.md#updating-vs-code" | 
|  | 106 | +  echo -e "For more info, see docs: docs/CONTRIBUTING.md#updating-vs-code\n" | 
| 98 | 107 |   git add . && git commit -am "chore(vscode): update to $VSCODE_EXACT_VERSION" | 
| 99 | 108 | 
 | 
| 100 | 109 |   # Note: we can't open a draft PR unless their are changes. | 
|  | 
0 commit comments