Skip to content

Commit

Permalink
fix: init error (#1353)
Browse files Browse the repository at this point in the history
* fix: init error

* Update config.mts
  • Loading branch information
typicode committed Jan 25, 2024
1 parent 26697d1 commit 56619ec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin.js
Expand Up @@ -7,7 +7,7 @@ let a = process.argv[2]
if (a == 'init') {
let p = 'package.json'
let d = JSON.parse(f.readFileSync(p))
(d.scripts ||= {}).prepare = 'husky'
;(d.scripts ||= {}).prepare = 'husky'
w('package.json', JSON.stringify(d, null, /\t/.test() ? '\t' : 2) + '\n')
process.stdout.write(i())
try { f.mkdirSync('.husky') } catch {}
Expand Down
3 changes: 2 additions & 1 deletion test.sh
Expand Up @@ -8,4 +8,5 @@ sh test/3_from-sub-dir.sh
sh test/4_not-git-dir.sh
sh test/5_git_command_not_found.sh
sh test/6_command_not_found.sh
# sh test/7_time.sh
sh test/7_init.sh
# sh test/8_time.sh
6 changes: 6 additions & 0 deletions test/7_init.sh
@@ -0,0 +1,6 @@
#!/bin/sh
. test/functions.sh
setup
install

npx --no-install husky init
File renamed without changes.

0 comments on commit 56619ec

Please sign in to comment.