Skip to content

Commit

Permalink
use rest param syntax to capture all git args
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirk McKelvey committed Jun 22, 2020
1 parent e5531f1 commit 8f05f8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function runCommand(
* @param {promise} options.getStdinFn - used for mocking only
*/
export default async function run(
[, , hookName = '', HUSKY_GIT_PARAMS]: string[],
[, , hookName = '', ...HUSKY_GIT_PARAMS]: string[],
{ cwd = process.cwd() }: { cwd?: string } = {}
): Promise<number> {
const oldCommand = getOldCommand(cwd, hookName)
Expand All @@ -83,8 +83,8 @@ export default async function run(
// Add HUSKY_GIT_PARAMS to env
const env: Env = {}

if (HUSKY_GIT_PARAMS) {
env.HUSKY_GIT_PARAMS = HUSKY_GIT_PARAMS
if (HUSKY_GIT_PARAMS?.length) {
env.HUSKY_GIT_PARAMS = HUSKY_GIT_PARAMS.join(' ')
}

if (command) {
Expand Down

0 comments on commit 8f05f8a

Please sign in to comment.