fix: use proper npm casing postinstall (#5848)

* fix: use proper npm casing postinstall

* chore: add log for npm config user agent

* fixup
This commit is contained in:
Joe Previte 2022-12-08 10:22:40 -07:00 committed by GitHub
parent 83c3453f50
commit c088e73063
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,10 +124,11 @@ 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
npm*)
*npm*)
if [ -f "yarn.lock" ]; then
echo "yarn.lock file present, running in development mode. use yarn to install code-server!"
exit 1