| 14 | const AVA_BINARY_NAMES = isWindows ? ['ava.cmd', 'ava.exe', 'ava.bat', 'ava.ps1', 'ava'] : ['ava']; |
| 15 | |
| 16 | const 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 | |
| 24 | const pathWithoutAva = getPathWithoutCommand(AVA_BINARY_NAMES); |
| 25 |