Skip to content

Commit

Permalink
style(shell): add trailing newlines (#870)
Browse files Browse the repository at this point in the history
Adds trailing newlines to files generated by the `install` and `add` commands.
  • Loading branch information
valtlai authored Feb 22, 2021
1 parent bb7021f commit 7387773
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
_
_
2 changes: 1 addition & 1 deletion src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function createHookFile(file: string, cmd: string) {
throw new Error(`${file} already exists`)
}

const data = ['#!/bin/sh', '. "$(dirname "$0")/_/husky.sh"', '', cmd].join(
const data = ['#!/bin/sh', '. "$(dirname "$0")/_/husky.sh"', '', cmd, ''].join(
'\n'
)

Expand Down
2 changes: 1 addition & 1 deletion src/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function install(dir = '.husky'): void {
fs.mkdirSync(path.join(dir, '_'), { recursive: true })

// Create .husky/.gitignore
fs.writeFileSync(path.join(dir, '.gitignore'), '_', 'utf-8')
fs.writeFileSync(path.join(dir, '.gitignore'), '_\n', 'utf-8')

// Copy husky.sh to .husky/_/husky.sh
fs.copyFileSync(
Expand Down

0 comments on commit 7387773

Please sign in to comment.