diff --git a/src/runner/__tests__/index.ts b/src/runner/__tests__/index.ts index b249afa0c..453084101 100644 --- a/src/runner/__tests__/index.ts +++ b/src/runner/__tests__/index.ts @@ -6,15 +6,12 @@ import index, { Env } from '../' let spy: jest.SpyInstance -// On AppVeyor $SHELL is not set -process.env.SHELL = process.env.SHELL || 'sh' - function expectSpawnSyncToHaveBeenCalledWith( cwd: string, cmd: string, env: Env = {} ): void { - expect(cp.spawnSync).toHaveBeenCalledWith(process.env.SHELL, ['-c', cmd], { + expect(cp.spawnSync).toHaveBeenCalledWith('sh', ['-c', cmd], { cwd, env: { ...process.env, ...env }, stdio: 'inherit' diff --git a/src/runner/index.ts b/src/runner/index.ts index fadf4008b..d7faf9724 100644 --- a/src/runner/index.ts +++ b/src/runner/index.ts @@ -39,8 +39,7 @@ function runCommand( ): number { console.log(`husky > ${hookName} (node ${process.version})`) - const SHELL = process.env.SHELL || 'sh' - const { status } = spawnSync(SHELL, ['-c', cmd], { + const { status } = spawnSync('sh', ['-c', cmd], { cwd, env: { ...process.env, ...env }, stdio: 'inherit'