From 4e1d440be7e3058036d24e7c5558c09448772af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Fri, 10 Apr 2020 00:00:00 +0800 Subject: [PATCH] fix: cnpm fails due to $packgeManager not matched (#687) * fix: cnpm fail cause packgeManager not matched close #682 close #676 close cnpm/cnpm#318 * test: fix jest snapshot --- sh/husky.sh | 3 ++- src/installer/__tests__/__snapshots__/scripts.ts.snap | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sh/husky.sh b/sh/husky.sh index 76671e926..b4a6673df 100644 --- a/sh/husky.sh +++ b/sh/husky.sh @@ -83,7 +83,8 @@ fi # Run husky-run with the package manager used to install Husky case $packageManager in "npm") run_command npx --no-install;; + "npminstall") run_command npx --no-install;; "pnpm") run_command pnpx --no-install;; "yarn") run_command yarn run --silent;; - "*") echo "Unknown package manager: $packageManager"; exit 0;; + *) echo "Unknown package manager: $packageManager"; exit 0;; esac diff --git a/src/installer/__tests__/__snapshots__/scripts.ts.snap b/src/installer/__tests__/__snapshots__/scripts.ts.snap index 6b2ec58c2..d4340ed3c 100644 --- a/src/installer/__tests__/__snapshots__/scripts.ts.snap +++ b/src/installer/__tests__/__snapshots__/scripts.ts.snap @@ -112,9 +112,10 @@ fi # Run husky-run with the package manager used to install Husky case $packageManager in \\"npm\\") run_command npx --no-install;; + \\"npminstall\\") run_command npx --no-install;; \\"pnpm\\") run_command pnpx --no-install;; \\"yarn\\") run_command yarn run --silent;; - \\"*\\") echo \\"Unknown package manager: $packageManager\\"; exit 0;; + *) echo \\"Unknown package manager: $packageManager\\"; exit 0;; esac " `;