From c1bbd9b8583d900171b6c81d751f11e506d12c1e Mon Sep 17 00:00:00 2001 From: typicode Date: Fri, 26 Jan 2024 00:41:29 +0100 Subject: [PATCH] style: indent --- bin.js | 18 +++++++++--------- husky.sh | 2 +- index.d.ts | 2 +- index.js | 2 +- package.json | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bin.js b/bin.js index 13011eb9..9d98ccf5 100755 --- a/bin.js +++ b/bin.js @@ -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)) \ No newline at end of file diff --git a/husky.sh b/husky.sh index 427840b7..cf335ec8 100644 --- a/husky.sh +++ b/husky.sh @@ -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 \ No newline at end of file diff --git a/index.d.ts b/index.d.ts index 9f8d3652..72a5495a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1 +1 @@ -export default function (dir?: string): string; +export default function (dir?: string): string; \ No newline at end of file diff --git a/index.js b/index.js index 66932771..030acd26 100644 --- a/index.js +++ b/index.js @@ -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 '' -} +} \ No newline at end of file diff --git a/package.json b/package.json index 30f03543..caa1e204 100644 --- a/package.json +++ b/package.json @@ -22,4 +22,4 @@ "engines": { "node": ">=18" } -} +} \ No newline at end of file