From 5b411df8653952f0c722acda0cc180bad7b8f435 Mon Sep 17 00:00:00 2001 From: cheney Date: Sat, 2 Apr 2022 17:34:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public.script/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public.script/index.js b/public.script/index.js index 558df14..328501b 100644 --- a/public.script/index.js +++ b/public.script/index.js @@ -13,7 +13,7 @@ function sync( cmds , options = {}){ } options = Object.assign({ - cwd : os.tmpdir(), + // cwd : os.tmpdir(), encoding: 'buffer' }, options) @@ -39,8 +39,8 @@ function sync( cmds , options = {}){ resolve({ pid : process.pid, exitCode : process.exitCode, - stdout : stdout, - stderr : stderr + stdout : stdout.toString(), + stderr : stderr.toString() }) } }) @@ -168,6 +168,7 @@ async function main() { sync('git status').then(function (value, error) { l.d( value ) + value = value.stdout + value.stderr if ( value.indexOf("Command failed") > 0 ){ throw new Error("请检查 git 命令")