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 3182be6

Browse files
authoredDec 7, 2022
refactor: use npm in build steps and postinstall.sh (#5844)
* refactor: default to npm in postinstall.sh yarn has a bug where it will try to update dependencies even if `yarn.lock` is present. Therefore we're defaulting to `npm` to prevent further issues. * refactor: exclude yarn.lock in standalone By excluding `yarn.lock`, we prevent issues where the user must use `yarn` instead of `npm` to install code-server.
1 parent 1297e9a commit 3182be6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed
 

‎ci/build/build-standalone-release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ main() {
1010

1111
source ./ci/lib.sh
1212

13-
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
13+
rsync --exclude yarn.lock "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
1414
RELEASE_PATH+=-standalone
1515

1616
# We cannot find the path to node from $PATH because yarn shims a script to ensure

‎ci/build/npm-postinstall.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,6 @@ install_with_yarn_or_npm() {
127127
# NOTE@edvincent: We want to keep using the package manager that the end-user was using to install the package.
128128
# This also ensures that when *we* run `yarn` in the development process, the yarn.lock file is used.
129129
case "${npm_config_user_agent-}" in
130-
yarn*)
131-
if [ -f "yarn.lock" ]; then
132-
yarn --production --frozen-lockfile --no-default-rc
133-
else
134-
echo "yarn.lock file not present, not running in development mode. use npm to install code-server!"
135-
exit 1
136-
fi
137-
;;
138130
npm*)
139131
if [ -f "yarn.lock" ]; then
140132
echo "yarn.lock file present, running in development mode. use yarn to install code-server!"
@@ -146,6 +138,14 @@ install_with_yarn_or_npm() {
146138
npm install --unsafe-perm --legacy-peer-deps --omit=dev
147139
fi
148140
;;
141+
yarn*)
142+
if [ -f "yarn.lock" ]; then
143+
yarn --production --frozen-lockfile --no-default-rc
144+
else
145+
echo "yarn.lock file not present, not running in development mode. use npm to install code-server!"
146+
exit 1
147+
fi
148+
;;
149149
*)
150150
echo "Could not determine which package manager is being used to install code-server"
151151
exit 1

0 commit comments

Comments
 (0)
Please sign in to comment.