Fix "rm: .git/hooks: No such file or directory" error in `pnpm install` when the directory is missing (#43142)
* Fix "rm: .git/hooks: No such file or directory" error in `pnpm install`. * Add changelog. * Use "rm -rf" instead of "test" command on .git/hooks directory. We use the "-f" flag so that it does not throw error when the directory does not exist.
This commit is contained in:
parent
ce3a38ac55
commit
8b1df6c946
|
@ -28,7 +28,7 @@
|
||||||
"clean": "pnpm store prune && git clean -fx **/node_modules && pnpm i",
|
"clean": "pnpm store prune && git clean -fx **/node_modules && pnpm i",
|
||||||
"preinstall": "npx only-allow pnpm",
|
"preinstall": "npx only-allow pnpm",
|
||||||
"postinstall": "pnpm git:update-hooks",
|
"postinstall": "pnpm git:update-hooks",
|
||||||
"git:update-hooks": "if test -d .git; then rm -r .git/hooks && mkdir -p .git/hooks && husky install; else husky install; fi",
|
"git:update-hooks": "if test -d .git; then rm -rf .git/hooks && mkdir -p .git/hooks && husky install; else husky install; fi",
|
||||||
"create-extension": "node ./tools/create-extension/index.js",
|
"create-extension": "node ./tools/create-extension/index.js",
|
||||||
"sync-dependencies": "pnpm exec syncpack -- fix-mismatches",
|
"sync-dependencies": "pnpm exec syncpack -- fix-mismatches",
|
||||||
"utils": "node ./tools/monorepo-utils/dist/index.js"
|
"utils": "node ./tools/monorepo-utils/dist/index.js"
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: dev
|
||||||
|
|
||||||
|
Fix "rm: .git/hooks: No such file or directory" error in `pnpm install`.
|
Loading…
Reference in New Issue