Skip to content

Commit

Permalink
fix: fix git hooks path on windows (#1346)
Browse files Browse the repository at this point in the history
  • Loading branch information
键来! committed Jan 25, 2024
1 parent b4eb153 commit 3148f7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default (d = '.husky') => {
if (!f.existsSync('.git')) return `.git can't be found`

let _ = (x = '') => p.join(d, '_', x)
let { status: s, stderr: e } = c.spawnSync('git', ['config', 'core.hooksPath', _()])
let { status: s, stderr: e } = c.spawnSync('git', ['config', 'core.hooksPath', `${d}/_`])
if (s == null) return 'git command not found'
if (s) return '' + e

Expand All @@ -20,4 +20,4 @@ export default (d = '.husky') => {
l.forEach(h => w(_(h), `#!/usr/bin/env sh\n. "\${0%/*}/h"`, { mode: 0o755 }))
w(_('husky.sh'), '')
return ''
}
}

0 comments on commit 3148f7e

Please sign in to comment.