Skip to content

Commit

Permalink
fix runner should not run old hooks defined in pkg.scripts if another…
Browse files Browse the repository at this point in the history
… one is in the new config
  • Loading branch information
typicode committed Aug 8, 2019
1 parent 12bdd4c commit 6a2d457
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/runner/index.ts
Expand Up @@ -60,11 +60,6 @@ export default async function run(
env.HUSKY_GIT_STDIN = await getStdinFn()
}

if (command) {
console.log(`husky > ${hookName} (node ${process.version})`)
execa.shellSync(command, { cwd, env, stdio: 'inherit' })
}

if (oldCommand) {
console.log()
console.log(
Expand All @@ -79,8 +74,11 @@ export default async function run(
console.log()
console.log(`See https://github.com/typicode/husky for usage`)
console.log()
}

if (command || oldCommand) {
console.log(`husky > ${hookName} (node ${process.version})`)
execa.shellSync(oldCommand, { cwd, env, stdio: 'inherit' })
execa.shellSync(command || oldCommand, { cwd, env, stdio: 'inherit' })
}

return 0
Expand Down

0 comments on commit 6a2d457

Please sign in to comment.