mirror of
https://github.com/a2-4am/4cade.git
synced 2024-09-30 00:56:24 +00:00
sync
This commit is contained in:
parent
e476891ee3
commit
8ed18022b2
32
bin/subst.js
32
bin/subst.js
@ -2,19 +2,32 @@ a = new ActiveXObject("scripting.filesystemobject")
|
|||||||
|
|
||||||
if (!a.fileexists(WScript.Arguments(1)) || a.getfile(WScript.Arguments(1)).datelastmodified < a.getFile(WScript.Arguments(0)).datelastmodified)
|
if (!a.fileexists(WScript.Arguments(1)) || a.getfile(WScript.Arguments(1)).datelastmodified < a.getFile(WScript.Arguments(0)).datelastmodified)
|
||||||
{
|
{
|
||||||
b = a.opentextfile(WScript.Arguments(0)).readall().replace(/\r\n/g, "\n")
|
z = a.opentextfile(WScript.Arguments(0))
|
||||||
c = b.search(/\[eof\]/)
|
d = a.createtextfile(WScript.Arguments(1))
|
||||||
|
|
||||||
if (c > -1)
|
|
||||||
{
|
|
||||||
b = b.substr(0, c) + String.fromCharCode(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
String.prototype.replaceWith = function(q)
|
String.prototype.replaceWith = function(q)
|
||||||
{
|
{
|
||||||
return this.substr(0, c) + String.fromCharCode(q) + this.substr(c + 1)
|
return this.substr(0, c) + String.fromCharCode(q) + this.substr(c + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (!z.atendofstream)
|
||||||
|
{
|
||||||
|
b = z.readline()
|
||||||
|
|
||||||
|
c = b.search(/\[eof\]/)
|
||||||
|
|
||||||
|
if (c > -1)
|
||||||
|
{
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
c = b.search(/\r\n/)
|
||||||
|
|
||||||
|
if (c > -1)
|
||||||
|
{
|
||||||
|
b = b.substr(0, c)
|
||||||
|
}
|
||||||
|
|
||||||
for (c = 0; c < b.length; c++)
|
for (c = 0; c < b.length; c++)
|
||||||
{
|
{
|
||||||
if (b.charAt(c) == '*')
|
if (b.charAt(c) == '*')
|
||||||
@ -43,5 +56,8 @@ if (!a.fileexists(WScript.Arguments(1)) || a.getfile(WScript.Arguments(1)).datel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
a.createtextfile(WScript.Arguments(1)).write(b)
|
d.write(String.fromCharCode(b.length) + b)
|
||||||
|
}
|
||||||
|
|
||||||
|
d.write(String.fromCharCode(255))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user