From c71435a8cb52e11f1606dcaedff1c558eb74f917 Mon Sep 17 00:00:00 2001 From: Otoha Funabashi Date: Sun, 22 Jan 2017 07:53:57 +0900 Subject: [PATCH] shelljs: update exec for after v0.6.0 (#14143) * shelljs: update for after v0.6.0 exec.output was changed to exec.stdout, and missing exec.stderr. stderr: https://github.com/shelljs/shelljs/commit/74f1ff8748ab8261ad20062dfee40d39103e0a98 stdout: https://github.com/shelljs/shelljs/commit/8a7f7ceec4d3a77a9309d935755675ac368b1eda * shelljs: update testcode --- shelljs/index.d.ts | 7 ++++--- shelljs/shelljs-tests.ts | 16 ++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/shelljs/index.d.ts b/shelljs/index.d.ts index 26f92c379f..5e812947fd 100644 --- a/shelljs/index.d.ts +++ b/shelljs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ShellJS v0.3.0 +// Type definitions for ShellJS v0.6.0 // Project: http://shelljs.org // Definitions by: Niklas Mollenhauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -463,7 +463,7 @@ export declare function exec(command: string, options: ExecOptions, callback: Ex export declare function exec(command: string, callback: ExecCallback): child.ChildProcess; export interface ExecCallback { - (code: number, output: string, error?: string): any; + (code: number, stdout: string, stderr: string): any; } export interface ExecOptions { @@ -473,7 +473,8 @@ export interface ExecOptions { export interface ExecOutputReturnValue { code: number; - output: string; + stdout: string; + stderr: string; } /** diff --git a/shelljs/shelljs-tests.ts b/shelljs/shelljs-tests.ts index 7934046d0a..a78b8e44e1 100644 --- a/shelljs/shelljs-tests.ts +++ b/shelljs/shelljs-tests.ts @@ -86,22 +86,22 @@ var testPath = shell.env["path"]; import child = require("child_process"); -var version = shell.exec("node --version").output; +var version = shell.exec("node --version").stdout; var version2 = shell.exec("node --version", { async: false }); -var output = version2.output; +var output = version2.stdout; var asyncVersion3 = shell.exec("node --version", { async: true }); var pid = asyncVersion3.pid; -shell.exec("node --version", { silent: true }, function (code, output) { - var version = output; +shell.exec("node --version", { silent: true }, function (code, stdout, stderr) { + var version = stdout; }); -shell.exec("node --version", { silent: true, async: true }, function (code, output) { - var version = output; +shell.exec("node --version", { silent: true, async: true }, function (code, stdout, stderr) { + var version = stdout; }); -shell.exec("node --version", function (code, output) { - var version = output; +shell.exec("node --version", function (code, stdout, stderr) { + var version = stdout; }); shell.exec("node --version", function (code: number) { var num: number = code;