mirror of
https://github.com/a2-4am/4cade.git
synced 2024-11-26 17:49:43 +00:00
sync
This commit is contained in:
parent
e476891ee3
commit
8ed18022b2
70
bin/subst.js
70
bin/subst.js
@ -2,46 +2,62 @@ a = new ActiveXObject("scripting.filesystemobject")
|
||||
|
||||
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")
|
||||
c = b.search(/\[eof\]/)
|
||||
|
||||
if (c > -1)
|
||||
{
|
||||
b = b.substr(0, c) + String.fromCharCode(0)
|
||||
}
|
||||
z = a.opentextfile(WScript.Arguments(0))
|
||||
d = a.createtextfile(WScript.Arguments(1))
|
||||
|
||||
String.prototype.replaceWith = function(q)
|
||||
{
|
||||
return this.substr(0, c) + String.fromCharCode(q) + this.substr(c + 1)
|
||||
}
|
||||
|
||||
for (c = 0; c < b.length; c++)
|
||||
while (!z.atendofstream)
|
||||
{
|
||||
if (b.charAt(c) == '*')
|
||||
b = z.readline()
|
||||
|
||||
c = b.search(/\[eof\]/)
|
||||
|
||||
if (c > -1)
|
||||
{
|
||||
b = b.replaceWith(16)
|
||||
break
|
||||
}
|
||||
else if (b.charAt(c) == '~')
|
||||
|
||||
c = b.search(/\r\n/)
|
||||
|
||||
if (c > -1)
|
||||
{
|
||||
b = b.replaceWith(17)
|
||||
b = b.substr(0, c)
|
||||
}
|
||||
else if (b.charAt(c) == '<')
|
||||
|
||||
for (c = 0; c < b.length; c++)
|
||||
{
|
||||
b = b.replaceWith(8)
|
||||
}
|
||||
else if (b.charAt(c) == '>')
|
||||
{
|
||||
b = b.replaceWith(21)
|
||||
}
|
||||
else if (b.charAt(c) == '$')
|
||||
{
|
||||
b = b.replaceWith(14)
|
||||
}
|
||||
else if (b.charAt(c) == '%')
|
||||
{
|
||||
b = b.replaceWith(15)
|
||||
if (b.charAt(c) == '*')
|
||||
{
|
||||
b = b.replaceWith(16)
|
||||
}
|
||||
else if (b.charAt(c) == '~')
|
||||
{
|
||||
b = b.replaceWith(17)
|
||||
}
|
||||
else if (b.charAt(c) == '<')
|
||||
{
|
||||
b = b.replaceWith(8)
|
||||
}
|
||||
else if (b.charAt(c) == '>')
|
||||
{
|
||||
b = b.replaceWith(21)
|
||||
}
|
||||
else if (b.charAt(c) == '$')
|
||||
{
|
||||
b = b.replaceWith(14)
|
||||
}
|
||||
else if (b.charAt(c) == '%')
|
||||
{
|
||||
b = b.replaceWith(15)
|
||||
}
|
||||
}
|
||||
|
||||
d.write(String.fromCharCode(b.length) + b)
|
||||
}
|
||||
|
||||
a.createtextfile(WScript.Arguments(1)).write(b)
|
||||
d.write(String.fromCharCode(255))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user