* Spawns a shell executing the given `command` synchronously. * @param {string} command * @param {{ * cwd?: string | URL; * input?: string | Buffer | TypedArray | DataView; * stdio?: string | Array; * env?: Record ; * shell?: string; * uid?: number; * gid?: numb
(command, options)
| 987 | * @returns {Buffer | string} |
| 988 | */ |
| 989 | function execSync(command, options) { |
| 990 | const opts = normalizeExecArgs(command, options, null); |
| 991 | const inheritStderr = !opts.options.stdio; |
| 992 | |
| 993 | const ret = spawnSync(opts.file, opts.options); |
| 994 | |
| 995 | if (inheritStderr && ret.stderr) |
| 996 | process.stderr.write(ret.stderr); |
| 997 | |
| 998 | const err = checkExecSyncError(ret, undefined, command); |
| 999 | |
| 1000 | if (err) |
| 1001 | throw err; |
| 1002 | |
| 1003 | return ret.stdout; |
| 1004 | } |
| 1005 | |
| 1006 | |
| 1007 | function validateArgumentNullCheck(arg, propName) { |
no test coverage detected
searching dependent graphs…