Skip to content

Commit

Permalink
upgrader: Add trailing newline to package.json (#362)
Browse files Browse the repository at this point in the history
By default npm includes a trailing newline when it writes the `package.json`. this preserves that behavior to not cause churn in the file in the most common case.
  • Loading branch information
JHilker authored and typicode committed Sep 27, 2018
1 parent 582b6b6 commit 5926ac6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/upgrader/index.ts
Expand Up @@ -57,7 +57,7 @@ export default function upgrade(cwd: string) {
})

// Update package.json
fs.writeFileSync(pkgFile, JSON.stringify(pkg, null, 2), 'utf-8')
fs.writeFileSync(pkgFile, `${JSON.stringify(pkg, null, 2)}\n`, 'utf-8')
console.log(`husky > done`)
}
}

0 comments on commit 5926ac6

Please sign in to comment.