File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ let a = process.argv[2]
66
77if ( a == 'init' ) {
88 let p = 'package.json'
9- let d = JSON . parse ( f . readFileSync ( p ) )
9+ let s = f . readFileSync ( p ) ;
10+ let d = JSON . parse ( s )
1011 ; ( 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' )
1213 process . stdout . write ( i ( ) )
1314 try { f . mkdirSync ( '.husky' ) } catch { }
1415 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`)
1920if ( [ 'add' , 'set' , 'uninstall' ] . includes ( a ) ) { d ( a ) ; process . exit ( 1 ) }
2021if ( a == 'install' ) d ( a )
2122
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