Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b3811a6

Browse files
authoredOct 7, 2020
Add $KEEP_MODULES argument to build-release.sh (#2167)
1 parent b415b75 commit b3811a6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed
 

‎ci/build/build-release.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ set -euo pipefail
66
# MINIFY controls whether minified vscode is bundled.
77
MINIFY="${MINIFY-true}"
88

9+
# KEEP_MODULES controls whether the script cleans all node_modules requiring a yarn install
10+
# to run first.
11+
KEEP_MODULES="${KEEP_MODULES-0}"
12+
913
main() {
1014
cd "$(dirname "${0}")/../.."
1115
source ./ci/lib.sh
@@ -52,6 +56,11 @@ EOF
5256
) > "$RELEASE_PATH/package.json"
5357
rsync yarn.lock "$RELEASE_PATH"
5458
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
59+
60+
61+
if [ "$KEEP_MODULES" = 1 ]; then
62+
rsync node_modules/ "$RELEASE_PATH/node_modules"
63+
fi
5564
}
5665

5766
bundle_vscode() {
@@ -60,7 +69,11 @@ bundle_vscode() {
6069
rsync "$VSCODE_SRC_PATH/out-vscode${MINIFY+-min}/" "$VSCODE_OUT_PATH/out"
6170

6271
rsync "$VSCODE_SRC_PATH/.build/extensions/" "$VSCODE_OUT_PATH/extensions"
63-
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
72+
if [ "$KEEP_MODULES" = 0 ]; then
73+
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
74+
else
75+
rsync "$VSCODE_SRC_PATH/node_modules/" "$VSCODE_OUT_PATH/node_modules"
76+
fi
6477
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions"
6578
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions"
6679
rsync "$VSCODE_SRC_PATH/extensions/postinstall.js" "$VSCODE_OUT_PATH/extensions"

0 commit comments

Comments
 (0)
Please sign in to comment.