MCPcopy Create free account
hub / github.com/sindresorhus/execa / getPathWithoutCommand

Function getPathWithoutCommand

test/arguments/local.js:16–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14const AVA_BINARY_NAMES = isWindows ? ['ava.cmd', 'ava.exe', 'ava.bat', 'ava.ps1', 'ava'] : ['ava'];
15
16const getPathWithoutCommand = commandNames => {
17 const newPath = process.env[PATH_KEY]
18 .split(path.delimiter)
19 .filter(pathDirectory => commandNames.every(commandName => !existsSync(path.join(pathDirectory, commandName))))
20 .join(path.delimiter);
21 return {[PATH_KEY]: newPath};
22};
23
24const pathWithoutAva = getPathWithoutCommand(AVA_BINARY_NAMES);
25

Callers 1

local.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected