Skip to content

Commit

Permalink
style: indent
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Jan 25, 2024
1 parent 2da78cb commit c1bbd9b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import i from './index.js'
let a = process.argv[2]

if (a == 'init') {
let p = 'package.json'
let d = JSON.parse(f.readFileSync(p))
;(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 {}
w('.husky/pre-commit', process.env.npm_config_user_agent.split('/')[0] + ' test\n')
process.exit()
let p = 'package.json'
let d = JSON.parse(f.readFileSync(p))
; (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 { }
w('.husky/pre-commit', process.env.npm_config_user_agent.split('/')[0] + ' test\n')
process.exit()
}

let d = c => console.error(`${c} command is deprecated`)
if (['add', 'set', 'uninstall'].includes(a)) { d(a); process.exit(1) }
if (a == 'install') d(a)

process.stdout.write(i(a == 'install' ? undefined : a))
process.stdout.write(i(a == 'install' ? undefined : a))
2 changes: 1 addition & 1 deletion husky.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ c=$?

[ $c != 0 ] && echo "husky - $h script failed (code $c)"
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH"
exit $c
exit $c
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default function (dir?: string): string;
export default function (dir?: string): string;
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"engines": {
"node": ">=18"
}
}
}

0 comments on commit c1bbd9b

Please sign in to comment.