我想在客户端编写 Tortoise SVN 更新后挂钩脚本。TSVN 传输以下参数:path/to/pathsfile、depth、revision、path/to/errorFile、path/to/CWD。我可以使用第一个参数获取所有更改的添加等文件,但我无法获取此文件的状态(更新、添加、删除等)。请帮忙,我该怎么做?
//code is very simple:)
var objArgs = WScript.Arguments;
var paths = readPaths(objArgs(0)); /*objArgs[0] - path to TSVN temp file which contains all the paths for svn update operation. Here I would like to get list of files which will be added in the working directory after update operation*/
command = "mvn help:effective-settings"
wshShell = new ActiveXObject("WScript.Shell");
var oExec = wshShell.Exec("cmd /c " + command);
var output = "";
if (!oExec.StdOut.AtEndOfStream) {
output = oExec.StdOut.ReadAll();
}
output = output.replace(new RegExp("\r*\n+", "g"), "");
//getting credentials for connecting to database
var uid = //getting userId
var password = //getting password
//next step - deploying added in a working copy files, but it doesn't matter
function readPaths(path) {
var retPaths = [];
var fs = new ActiveXObject("Scripting.FileSystemObject");
if (fs.FileExists(path)) {
var a = fs.OpenTextFile(path, 1);
while (!a.AtEndOfStream) {
var line = a.ReadLine();
retPaths.push(line);
}
a.Close();
}
return retPaths;
}