Created
September 20, 2011 14:16
-
-
Save jinwei233/1229185 to your computer and use it in GitHub Desktop.
svn gui 提交文件
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
/* | |
提交某个文件 | |
*/ | |
var spawn = require('child_process').spawn; | |
exe(["/c","TortoiseProc","/command:commit","/path:../att.cmd","/logmsg:update"]); | |
/* | |
0: success | |
1: fail at step1 | |
2: fail at step2 | |
*/ | |
function exe(command){ | |
var cmd = spawn("cmd",command); | |
cmd.stdout.setEncoding("ASCII"); | |
cmd.stdout.on("data",function(data){ | |
console.log("------------------------------"); | |
console.log("exec",command); | |
console.log("stdout:"+data); | |
}); | |
cmd.stderr.on("data",function(data){ | |
console.log("------------------------------"); | |
console.log("stderr:"+data); | |
console.log("------------------------------"); | |
}); | |
cmd.on("exit",function(code){ | |
console.log("exited with code:"+code); | |
console.log("------------------------------"); | |
}); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment