修改脚本

This commit is contained in:
cheney 2022-04-02 17:34:38 +08:00
parent 2f103856c8
commit 5b411df865

View File

@ -13,7 +13,7 @@ function sync( cmds , options = {}){
} }
options = Object.assign({ options = Object.assign({
cwd : os.tmpdir(), // cwd : os.tmpdir(),
encoding: 'buffer' encoding: 'buffer'
}, options) }, options)
@ -39,8 +39,8 @@ function sync( cmds , options = {}){
resolve({ resolve({
pid : process.pid, pid : process.pid,
exitCode : process.exitCode, exitCode : process.exitCode,
stdout : stdout, stdout : stdout.toString(),
stderr : stderr stderr : stderr.toString()
}) })
} }
}) })
@ -168,6 +168,7 @@ async function main() {
sync('git status').then(function (value, error) { sync('git status').then(function (value, error) {
l.d( value ) l.d( value )
value = value.stdout + value.stderr
if ( value.indexOf("Command failed") > 0 ){ if ( value.indexOf("Command failed") > 0 ){
throw new Error("请检查 git 命令") throw new Error("请检查 git 命令")