Add missing shelljs configuration options (#18548)

This commit is contained in:
Vojtech Jasny 2017-08-02 00:22:14 +02:00 committed by Sheetal Nandi
parent 0b2916b41e
commit 0860eda60e
2 changed files with 32 additions and 1 deletions

View File

@ -1,6 +1,7 @@
// Type definitions for ShellJS 0.7
// Project: http://shelljs.org
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>
// Vojtech Jasny <https://github.com/voy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
@ -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;
}
/**

View File

@ -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
};