From 057473a274fb6f78d5fd3d949e27c5e8969e203a Mon Sep 17 00:00:00 2001 From: "Adam J. Hines" Date: Fri, 8 Dec 2017 18:08:46 -0500 Subject: [PATCH] adding function definition for shelljs `set` function http://documentup.com/shelljs/shelljs#setoptions --- types/shelljs/index.d.ts | 6 ++++++ types/shelljs/shelljs-tests.ts | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/types/shelljs/index.d.ts b/types/shelljs/index.d.ts index c425ac6180..8d96561a1d 100644 --- a/types/shelljs/index.d.ts +++ b/types/shelljs/index.d.ts @@ -417,6 +417,12 @@ export function touch(files: string[]): void; export function touch(options: TouchOptionsLiteral, ...files: Array): void; export function touch(options: TouchOptionsArray, ...files: Array): void; +/** + * Sets global configuration variables + * @param options Available options: `+/-e`: exit upon error (`config.fatal`), `+/-v`: verbose: show all commands (`config.verbose`), `+/-f`: disable filename expansion (globbing) + */ +export function set(options: string): void; + // Configuration export interface ShellConfig { diff --git a/types/shelljs/shelljs-tests.ts b/types/shelljs/shelljs-tests.ts index 2e7c5e7e8d..f098e76f7a 100644 --- a/types/shelljs/shelljs-tests.ts +++ b/types/shelljs/shelljs-tests.ts @@ -106,6 +106,13 @@ const childProc = shell.exec("node --version", (code: number) => { }); pid = childProc.pid; +shell.set('+e'); +shell.set('-e'); +shell.set('+v'); +shell.set('-v'); +shell.set('+f'); +shell.set('-f'); + shell.chmod(755, "/Users/brandon"); shell.chmod("755", "/Users/brandon"); // same as above shell.chmod("u+x", "/Users/brandon");