Skip to content
Myr

Use `which-command` instead of `which` (#1253)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sindre Sorhus · committed by GitHub · parent c31c94c · Browse files · 3 files+10 added−36 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+10 added−36 removed

  • tests:+2 added−2 removed
  • other:+8 added−34 removed

3 files+10 added−36 removed

modified:lib/arguments/command-file.js+7 added-33 removed
modified:test/arguments/shell.js+2 added-2 removed
1import process from 'node:process';2import {pathToFileURL} from 'node:url';3import test from 'ava';4import which from 'which';4import {whichCommand} from 'which-command';5import {execa} from '../../index.js';6import {setFixtureDirectory} from '../helpers/fixtures-directory.js';7import {identity} from '../helpers/stdio.js';8
8 unmodified lines
17});1819const testShellPath = async (t, mapPath) => {20 const shellPath = isWindows ? 'cmd.exe' : 'bash';21 const shell = mapPath(await which(shellPath));21 const shell = mapPath(await whichCommand(shellPath));22 const {stdout} = await execa('node test/fixtures/noop.js foo', {shell});23 t.is(stdout, 'foo');24};25
2 unmodified lines
modified:package.json+1 added-1 removed
60 unmodified lines
61 "path-key": "^4.0.0",62 "pretty-ms": "^9.3.0",63 "signal-exit": "^4.1.0",64 "strip-final-newline": "^4.0.0",65 "which": "^7.0.0",65 "which-command": "^0.1.0",66 "yoctocolors": "^2.1.2"67 },68 "devDependencies": {69 "@types/node": "^26.1.0",
61 unmodified lines