From 0860eda60e56dd96edffee3b875a978958c1be05 Mon Sep 17 00:00:00 2001 From: Vojtech Jasny Date: Wed, 2 Aug 2017 00:22:14 +0200 Subject: [PATCH] Add missing shelljs configuration options (#18548) --- types/shelljs/index.d.ts | 23 +++++++++++++++++++++++ types/shelljs/shelljs-tests.ts | 10 +++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/types/shelljs/index.d.ts b/types/shelljs/index.d.ts index 3586ca06d7..f2a74bc561 100644 --- a/types/shelljs/index.d.ts +++ b/types/shelljs/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for ShellJS 0.7 // Project: http://shelljs.org // Definitions by: Niklas Mollenhauer +// Vojtech Jasny // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -523,6 +524,10 @@ export function touch(options: touchOptionsArray, files: string[]): void; // Configuration +export interface GlobOptions { + [key: string]: any; +} + export interface ShellConfig { /** * Suppresses all command output if true, except for echo() calls. Default is false. @@ -536,11 +541,29 @@ export interface ShellConfig { */ fatal: boolean; + /** + * Will print each executed command to the screen. Default is true. + * @type {boolean} + */ + verbose: boolean; + + /** + * Passed to glob.sync() instead of the default options ({}). + * @type {Object} + */ + globOptions: GlobOptions; + /** * Absolute path of the Node binary. Default is null (inferred). * @type {string|null} */ execPath: string | null; + + /** + * Reset shell.config to the defaults. + * @returns {void} + */ + reset(): void; } /** diff --git a/types/shelljs/shelljs-tests.ts b/types/shelljs/shelljs-tests.ts index e771eccbca..ff0567a32b 100644 --- a/types/shelljs/shelljs-tests.ts +++ b/types/shelljs/shelljs-tests.ts @@ -130,5 +130,13 @@ let tmp = shell.tempdir(); // "/tmp" for most *nix platforms let errorlol = shell.error(); -shell.config.fatal = true; +shell.config.reset(); shell.config.silent = true; +shell.config.fatal = true; +shell.config.verbose = true; +shell.config.execPath = null; +shell.config.execPath = '/bin/node'; +shell.config.globOptions = { + cwd: './', + dot: true +};