
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
// this script is a local post-update hook script. | |
// http://tortoisesvn.googlecode.com/svn/trunk/contrib/hook-scripts/client-side/PostUpdate.js.tmpl | |
var objArgs,num; | |
objArgs = WScript.Arguments; | |
num = objArgs.length; | |
if (num != 5) | |
{ | |
WScript.Echo("Usage: [CScript | WScript] PostUpdate.js path/to/pathsfile depth revision error path/to/CWD "); | |
WScript.Quit(1); | |
} | |
var paths = readPaths(objArgs(0)); | |
var rev=objArgs(2); | |
//WScript.Echo(rev); | |
var fs = new ActiveXObject("Scripting.FileSystemObject"); | |
var rev_file=paths+"/rev.txt"; | |
/* | |
WScript.Echo(rev_file); | |
if(!fs.FileExists(rev_file)){ | |
fs.CreateTextFile(rev_file,true); | |
} | |
*/ | |
var f=fs.OpenTextFile(rev_file,2,true); | |
f.Write(rev); | |
f.close(); | |
function readPaths(path) | |
{ | |
var retPaths = new Array(); | |
var fs = new ActiveXObject("Scripting.FileSystemObject"); | |
if (fs.FileExists(path)) | |
{ | |
var a = fs.OpenTextFile(path, 1, false); | |
var i = 0; | |
while (!a.AtEndOfStream) | |
{ | |
var line = a.ReadLine(); | |
retPaths[i] = line; | |
i = i + 1; | |
} | |
a.Close(); | |
} | |
return retPaths; | |
} |
沒有留言:
張貼留言