mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-02 09:30:03 +00:00
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:
committed by
Jesse Trinity
parent
c74ccad43c
commit
5759d05745
7
types/shelljs/index.d.ts
vendored
7
types/shelljs/index.d.ts
vendored
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user