Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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