Skip to content

Commit

Permalink
fix: migrate husky setup
Browse files Browse the repository at this point in the history
  • Loading branch information
nkgentile authored and stipsan committed Jul 30, 2024
1 parent 06cd611 commit 3a38d28
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions assets/inject/semver-workflow/.husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit ""
3 changes: 0 additions & 3 deletions assets/inject/semver-workflow/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
2 changes: 1 addition & 1 deletion src/presets/semver-workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function applyPreset(options: InjectOptions) {
async function addPrepareScript(options: InjectOptions) {
const pkg = await getPackage(options)
const didWrite = await addPackageJsonScripts(pkg, options, (scripts) => {
scripts.prepare = addScript(`husky install`, scripts.prepare)
scripts.prepare = addScript(`husky`, scripts.prepare)
return scripts
})
info(didWrite, 'Added prepare script to package.json')
Expand Down
2 changes: 1 addition & 1 deletion test/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ tap.test('plugin-kit init --force --preset semver-workflow in empty directory',
'should have expected devDependencies',
)

t.strictSame(pkg.scripts?.prepare, 'husky install')
t.strictSame(pkg.scripts?.prepare, 'husky')
},
})
})

0 comments on commit 3a38d28

Please sign in to comment.