From 30fe9514048a51238fb0abf45a81dd09999ae93f Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 8 Dec 2022 10:11:56 -0700 Subject: [PATCH 1/3] fix: use proper npm casing postinstall --- ci/build/npm-postinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index dc457935e282..4c3e1805d19f 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -127,7 +127,7 @@ install_with_yarn_or_npm() { # NOTE@edvincent: We want to keep using the package manager that the end-user was using to install the package. # This also ensures that when *we* run `yarn` in the development process, the yarn.lock file is used. case "${npm_config_user_agent-}" in - npm*) + *npm*) if [ -f "yarn.lock" ]; then echo "yarn.lock file present, running in development mode. use yarn to install code-server!" exit 1 From 4e3b7d3d0a90220c8dcec8b93002123d807121e2 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 8 Dec 2022 10:16:29 -0700 Subject: [PATCH 2/3] chore: add log for npm config user agent --- ci/build/npm-postinstall.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index 4c3e1805d19f..4400912f810d 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -124,6 +124,7 @@ main() { } install_with_yarn_or_npm() { + echo "User agent: "${npm_config_user_agent-none}"" # NOTE@edvincent: We want to keep using the package manager that the end-user was using to install the package. # This also ensures that when *we* run `yarn` in the development process, the yarn.lock file is used. case "${npm_config_user_agent-}" in From 4f94798fa58d34a264d099087430d3237901c1cb Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Thu, 8 Dec 2022 10:21:20 -0700 Subject: [PATCH 3/3] fixup --- ci/build/npm-postinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index 4400912f810d..b407a03dbfbb 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -124,7 +124,7 @@ main() { } install_with_yarn_or_npm() { - echo "User agent: "${npm_config_user_agent-none}"" + echo "User agent: ${npm_config_user_agent-none}" # NOTE@edvincent: We want to keep using the package manager that the end-user was using to install the package. # This also ensures that when *we* run `yarn` in the development process, the yarn.lock file is used. case "${npm_config_user_agent-}" in