(command)
| 25 | } |
| 26 | |
| 27 | function getWindowsCommand(command) { |
| 28 | var fullCommand; |
| 29 | var extension; |
| 30 | |
| 31 | // Do we got the value converted in the cache? |
| 32 | if (mout.object.hasOwn(winWhichCache, command)) { |
| 33 | return winWhichCache[command]; |
| 34 | } |
| 35 | |
| 36 | // Use which to retrieve the full command, which puts the extension in the end |
| 37 | try { |
| 38 | fullCommand = which.sync(command); |
| 39 | } catch (err) { |
| 40 | return (winWhichCache[command] = command); |
| 41 | } |
| 42 | |
| 43 | extension = path.extname(fullCommand).toLowerCase(); |
| 44 | |
| 45 | // Does it need to be converted? |
| 46 | if (winBatchExtensions.indexOf(extension) === -1) { |
| 47 | return (winWhichCache[command] = command); |
| 48 | } |
| 49 | |
| 50 | return (winWhichCache[command] = fullCommand); |
| 51 | } |
| 52 | |
| 53 | // Executes a shell command, buffering the stdout and stderr |
| 54 | // If an error occurs, a meaningful error is generated |
no outgoing calls
no test coverage detected
searching dependent graphs…