From 6e8bdd33f8efa4a3a42e4b8d49d22c5a8e57ccf6 Mon Sep 17 00:00:00 2001 From: Cloyd Lau <31238760+cloydlau@users.noreply.github.com> Date: Thu, 7 Sep 2023 08:36:03 +0800 Subject: [PATCH] fix: conditionally run preinstall hook --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 34610f5..0d9ded7 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "test-unit": "vitest run", "coverage": "vitest run --coverage", "release": "esno ./scripts/release.mts", - "preinstall": "npx only-allow pnpm", + "preinstall": "node -e \"if (process.env.INIT_CWD === process.cwd()) { process.exit(1) }\" || npx only-allow pnpm", "postinstall": "node -e \"if (process.env.INIT_CWD === process.cwd()) { process.exit(1) }\" || npx simple-git-hooks" }, "peerDependencies": {