Skip to content

Commit 5b4b95b

Browse files
committed
feat(hooks): install using 'prepare' in package.json
Signed-off-by: Dhruv Arora <dhruv.arora1@autodesk.com>
1 parent 5aafdb8 commit 5b4b95b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fission/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ These core systems make up the lion's share of the fission source code. Each sys
132132
| `assetpack` | Downloads the assetpack and unzips/installs it in the correct location. |
133133
| `assetpack:update` | Downloads the assetpack and unzips/installs it in the correct location, replacing the old directory if it exists. |
134134
| `playwright:install` | Downloads the Playwright browsers. |
135-
| `hooks:install` | Points `core.hooksPath` at `fission/scripts/hooks`, enabling the Biome pre-commit hook. Run automatically by `init`. |
135+
| `prepare` | Run automatically by `bun i`. Adds a line to `.git/hooks/pre-commit` which runs `scripts/hooks/pre-commit`. |

fission/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"assetpack:update": "bun update_manifest.ts && cd public && zip -FS -r assetpack.zip Downloadables -x '**/.*' -x '**/__MACOSX'",
2828
"assetpack:merge": "git checkout --theirs public/assetpack.zip && rm -rf public/Downloadables && tar -xf public/assetpack.zip -C public/ && git checkout --ours public/assetpack.zip && tar -xf public/assetpack.zip -C public/ && bun run assetpack:update",
2929
"playwright:install": "bun x playwright install",
30-
"hooks:install": "git config core.hooksPath fission/scripts/hooks",
30+
"prepare": "f=$(git rev-parse --git-path hooks/pre-commit 2>/dev/null) || exit 0; [ -e \"$f\" ] || printf '#!/bin/sh\\n' > \"$f\"; grep -q fission/scripts/hooks/pre-commit \"$f\" || printf 'sh ./fission/scripts/hooks/pre-commit\\n' >> \"$f\"; chmod +x \"$f\"",
3131
"lockfile:clean": "bun x replace-regex --from='https:\\/\\/npm.autodesk.com\\/artifactory\\/[a-zA-Z0-9_.\\/@-]*' --to='' ./bun.lock",
3232
"postinstall": "bun run lockfile:clean | bun x dev-null"
3333
},

0 commit comments

Comments
 (0)