Permalink
Cannot retrieve contributors at this time
39 lines (28 sloc)
1.16 KB
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/cross-spawn/index.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const cp = require('child_process'); | |
const parse = require('./lib/parse'); | |
const enoent = require('./lib/enoent'); | |
function spawn(command, args, options) { | |
// Parse the arguments | |
const parsed = parse(command, args, options); | |
// Spawn the child process | |
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); | |
// Hook into child process "exit" event to emit an error if the command | |
// does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 | |
enoent.hookChildProcess(spawned, parsed); | |
return spawned; | |
} | |
function spawnSync(command, args, options) { | |
// Parse the arguments | |
const parsed = parse(command, args, options); | |
// Spawn the child process | |
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); | |
// Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 | |
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); | |
return result; | |
} | |
module.exports = spawn; | |
module.exports.spawn = spawn; | |
module.exports.sync = spawnSync; | |
module.exports._parse = parse; | |
module.exports._enoent = enoent; |