Skip to content

Commit ac21f85

Browse files
committed
Use --exclude to skip node_modules
Instead of copying and then deleting them. This will also catch some node_modules directories that were missed.
1 parent 18e19d2 commit ac21f85

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

ci/build/build-release.sh

+19-10
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,25 @@ EOF
7878
bundle_vscode() {
7979
mkdir -p "$VSCODE_OUT_PATH"
8080

81-
# - Some extensions have a .gitignore which excludes their built source from
82-
# the npm package so exclude any .gitignore files.
83-
# - Exclude Node as we will add it ourselves for the standalone and will not
84-
# need it for the npm package.
85-
rsync -avh --exclude .gitignore --exclude /node ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
81+
local rsync_opts=()
82+
if [[ ${DEBUG-} = 1 ]]; then
83+
rsync_opts+=(-vh)
84+
fi
85+
86+
# Some extensions have a .gitignore which excludes their built source from the
87+
# npm package so exclude any .gitignore files.
88+
rsync_opts+=(--exclude .gitignore)
89+
90+
# Exclude Node as we will add it ourselves for the standalone and will not
91+
# need it for the npm package.
92+
rsync_opts+=(--exclude /node)
93+
94+
# Exclude Node modules.
95+
if [ $KEEP_MODULES = 0 ]; then
96+
rsync_opts+=(--exclude node_modules)
97+
fi
98+
99+
rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
86100

87101
# Add the commit, date, our name, links, and enable telemetry. This just makes
88102
# telemetry available; telemetry can still be disabled by flag or setting.
@@ -131,11 +145,6 @@ EOF
131145

132146
rsync "$VSCODE_SRC_PATH/remote/yarn.lock" "$VSCODE_OUT_PATH/yarn.lock"
133147

134-
if [ "$KEEP_MODULES" = 0 ]; then
135-
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
136-
rm -Rf "$VSCODE_OUT_PATH/node_modules"
137-
fi
138-
139148
pushd "$VSCODE_OUT_PATH"
140149
symlink_asar
141150
popd

0 commit comments

Comments
 (0)