var path = require(‘path’); var child = require(‘child_process’); var exec = child.exec; //提交暂存区的指定文件到仓库区 child.exec(’/usr/bin/git commit -m “11111”’, {cwd: ‘/Users/wangchengjun/www/yooli/femock’}, function(error, stdout, stderr){ if(error){ throw error; } console.log(stdout); });
Error: Command failed: /usr/bin/git commit -m “11111”
at ChildProcess.exithandler (child_process.js:206:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)