From 34ace2634171dd99fc852d4bd5f680ca3c2ea073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=AE=E6=9D=A5=EF=BC=81?= Date: Thu, 25 Jan 2024 22:26:45 +0800 Subject: [PATCH] fix: fix init not work on pnpm #1334 (#1347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: fix init not work on pnpm #1334 * doc: pnpm users must run init on project root * Update bin.js * Update bin.js * Update get-started.md --------- Co-authored-by: 键来! Co-authored-by: typicode --- bin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin.js b/bin.js index 17fc9030c..11164946d 100755 --- a/bin.js +++ b/bin.js @@ -5,7 +5,7 @@ import i from './index.js' let a = process.argv[2] if (a == 'init') { - let p = process.env.npm_package_json + let p = 'package.json' let d = JSON.parse(f.readFileSync(p)) (d.scripts ||= {}).prepare = 'husky' w('package.json', JSON.stringify(d, null, /\t/.test() ? '\t' : 2) + '\n')