Add missing shelljs.exec option (#40048)

* Add missing shelljs.exec option

* Add test for fatal being true and false

* Standardize layout

* Formatting improvement

* Take stdout from the correct variable

* Add missing period
This commit is contained in:
Peter Belbin
2019-11-01 11:17:52 -05:00
committed by Jesse Trinity
parent c74ccad43c
commit 5759d05745
2 changed files with 15 additions and 0 deletions

View File

@@ -835,6 +835,13 @@ export interface ExecOptions extends child.ExecOptions {
*/
silent?: boolean;
/**
* Exit when command return code is non-zero.
*
* @default false
*/
fatal?: boolean;
/**
* Asynchronous execution.
*

View File

@@ -92,6 +92,14 @@ const version = shell.exec("node --version").stdout;
const version2 = shell.exec("node --version", {async: false});
const output = version2.stdout;
// $ExpectType ShellString
const version3 = shell.exec("node --version", {async: false, fatal: false});
const output3 = version3.stdout;
// $ExpectType ShellString
const version4 = shell.exec("node --version", {async: false, fatal: true});
const output4 = version4.stdout;
// $ExpectType ChildProcess
const asyncVersion3 = shell.exec("node --version", {async: true});
let pid = asyncVersion3.pid;