Skip to content

Commit

Permalink
refactor(husky-init): removed duplicated code (typicode#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
fearphage authored and nikoladavitkovski committed Sep 5, 2022
1 parent e5fa931 commit e79e0f7
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/husky-init/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ export function updatePkg(pkg: PackageJson, isYarn2: boolean): PackageJson {
pkg.devDependencies ||= {}
pkg.devDependencies.husky = '^6.0.0'
if (isYarn2) {
pkg.scripts ||= {}
appendScript(pkg, 'postinstall', 'husky install')
if (pkg.private !== true) {
appendScript(pkg, 'prepublishOnly', 'pinst --disable')
appendScript(pkg, 'postpublish', 'pinst --enable')
pkg.devDependencies.pinst = '^2.0.0'
}
} else {
pkg.scripts ||= {}
appendScript(pkg, 'prepare', 'husky install')
}

Expand Down

0 comments on commit e79e0f7

Please sign in to comment.