-
-
Save niftydevelopment/7f4a51c374fb28711fadec07e16d8e78 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let spawn = require('child_process').spawn; | |
let Promise = require('promise'); | |
let path = require('path'); | |
const gitCheck = () => { | |
return new Promise((res, rej) => { | |
console.log('git check'); | |
let cmd = spawn('cmd', ['git pull']); | |
cmd.stdout.on('data', data => process.stdout.write(data)); | |
cmd.stderr.on('data', data => process.stderr.write(data)); | |
cmd.on('exit', data => { | |
console.log(data); | |
res('exit'); | |
}); | |
cmd.on('close', data => { | |
console.log(data); | |
res('exit'); | |
}); | |
cmd.on('error', data => { | |
console.log(data); | |
res('error:' + data); | |
}); | |
}) | |
} | |
gitCheck().then(r => { | |
console.log(r); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment