Skip to content

Commit 3e79a84

Browse files
committed
feat: add docs and update PR body
1 parent 612b831 commit 3e79a84

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

ci/dev/update-vscode.sh

+16-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
#!/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+
212
set -euo pipefail
313

414
# This function expects two arguments
515
# 1. the vscode version we're updating to
616
# 2. the list of merge conflict files
7-
make_pr_body(){
17+
make_pr_body() {
818
local BODY="This PR updates vscode to $1
919
1020
## TODOS
@@ -87,21 +97,20 @@ main() {
8797

8898
# Get the files with conflicts before we commit them
8999
# so we can list them in the PR body
90-
CONFLICTS=$(git diff --name-only --diff-filter=U | while read line; do echo "- $line"; done)
91-
92-
PR_BODY=$(make_pr_body $VSCODE_EXACT_VERSION $CONFLICTS)
100+
CONFLICTS=$(git diff --name-only --diff-filter=U | while read -r line; do echo "- $line"; done)
101+
PR_BODY=$(make_pr_body "$VSCODE_EXACT_VERSION" "$CONFLICTS")
93102
94-
echo "Forcing a commit with conflicts"
103+
echo -e "\nForcing a commit with conflicts"
95104
echo "Note: this is intentional"
96105
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"
98107
git add . && git commit -am "chore(vscode): update to $VSCODE_EXACT_VERSION"
99108
100109
# Note: we can't open a draft PR unless their are changes.
101110
# Hence why we do this after the subtree update.
102111
echo "Opening a draft PR on GitHub"
103112
# To read about these flags, visit the docs: https://cli.github.com/manual/gh_pr_create
104-
gh pr create --base master --title "feat(vscode): update to version $VSCODE_EXACT_VERSION" --body $PR_BODY --reviewer @cdr/code-server-reviewers --repo cdr/code-server --draft
113+
gh pr create --base master --title "feat(vscode): update to version $VSCODE_EXACT_VERSION" --body "$PR_BODY" --reviewer @cdr/code-server-reviewers --repo cdr/code-server --draft
105114
}
106115
107116
main "$@"

0 commit comments

Comments
 (0)