我写这个脚本:
const spawn = util.promisify(require('child_process').spawn);
function init() {
return spawn('git', ['init'], { stdio: 'inherit' });
}
function add() {
return spawn('git', ['add', '.'], { stdio: 'inherit' });
}
(async function final() {
try {
await init();
add();
} catch (e) {
throw e;
}
})();
So, git init
work's but I can not do the add
command and commit
.
我尝试过,做了一些研究,但仍然受阻。谢谢您帮忙。