@@ -17,10 +17,10 @@ function remove_patches() {
1717
1818function update_vscode() {
1919 pushd lib/vscode
20- if ! git checkout " $VERSION " ; then
21- echo " $VERSION does not exist locally, fetching..."
20+ if ! git checkout " $target_vscode_version " ; then
21+ echo " $target_vscode_version does not exist locally, fetching..."
2222 git fetch --all --prune
23- git checkout " $VERSION "
23+ git checkout " $target_vscode_version "
2424 fi
2525 popd
2626}
@@ -110,12 +110,12 @@ function run() {
110110
111111function add_changelog() {
112112 local file=CHANGELOG.md
113- if grep " Code $VERSION " " $file " ; then
114- echo " Changelog for $VERSION already exists"
113+ if grep " Code $target_vscode_version " " $file " ; then
114+ echo " Changelog for $target_vscode_version already exists"
115115 else
116116 # TODO: This is not exactly robust. In particular, it needs to handle if
117117 # there is already a "changed" section.
118- sed -i.bak " s/## Unreleased/## Unreleased\n\nCode v$VERSION \n\n### Changed\n\n- Update to Code $VERSION /" " $file "
118+ sed -i.bak " s/## Unreleased/## Unreleased\n\nCode v$target_vscode_version \n\n### Changed\n\n- Update to Code $target_vscode_version /" " $file "
119119 fi
120120}
121121
@@ -127,6 +127,9 @@ function main() {
127127 local target_node_version
128128 target_node_version=$( grep target lib/vscode/remote/.npmrc | awk -F= ' {print $2}' | tr -d ' "' )
129129
130+ local target_vscode_version
131+ target_vscode_version=" ${VERSION# v} "
132+
130133 declare -a steps
131134 # Removing patches only needs to be done locally; in CI we start from a fresh
132135 # clone each time.
@@ -135,7 +138,7 @@ function main() {
135138 fi
136139
137140 steps+=(
138- " Update VS Code to $VERSION " " update_vscode"
141+ " Update VS Code to $target_vscode_version " " update_vscode"
139142 " Refresh VS Code patches" " refresh_patches"
140143 " Set Node version to $target_node_version " " update_node"
141144 " Update CSP webview hash" " update_csp"
0 commit comments