File tree 1 file changed +4
-3
lines changed 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ let a = process.argv[2]
6
6
7
7
if ( a == 'init' ) {
8
8
let p = 'package.json'
9
- let d = JSON . parse ( f . readFileSync ( p ) )
9
+ let s = f . readFileSync ( p ) ;
10
+ let d = JSON . parse ( s )
10
11
; ( d . scripts ||= { } ) . prepare = 'husky'
11
- w ( 'package.json' , JSON . stringify ( d , null , / \t / . test ( ) ? '\t' : 2 ) + '\n' )
12
+ w ( 'package.json' , JSON . stringify ( d , null , / \t / . test ( s ) ? '\t' : 2 ) + '\n' )
12
13
process . stdout . write ( i ( ) )
13
14
try { f . mkdirSync ( '.husky' ) } catch { }
14
15
w ( '.husky/pre-commit' , process . env . npm_config_user_agent . split ( '/' ) [ 0 ] + ' test\n' )
@@ -19,4 +20,4 @@ let d = c => console.error(`${c} command is deprecated`)
19
20
if ( [ 'add' , 'set' , 'uninstall' ] . includes ( a ) ) { d ( a ) ; process . exit ( 1 ) }
20
21
if ( a == 'install' ) d ( a )
21
22
22
- process . stdout . write ( i ( a == 'install' ? undefined : a ) )
23
+ process . stdout . write ( i ( a == 'install' ? undefined : a ) )
You can’t perform that action at this time.
0 commit comments