web update

”’

tmp file to save last directory version info

”’

 

import os;
myver = “1.0.1”
”’
head
”’
os.system(“layacmd resourceVersion -i assets -o . -n “+myver);
f = open(“.record”,”r”,encoding=”utf8″);
s = f.read();
s1 = s.replace(“</manifest></record>”,””);
f.close();

mani = open(“manifest.json”,encoding=”utf8″);
m = mani.read();
m1 = m.replace(“}”,”,”);
mani.close();
”’
middle
”’
try:
tmp = open(“jsTmp”,”r”,encoding=”utf8″);
if tmp:
print(“jsTmp”);
f = open(“.record”,”w”,encoding=”utf8″);
f.write(tmp.read());
f.close();
tmp.close();
except Exception as e:
print(” jsTmp is not exist”)

try:
tmp = open(“jsMTmp”,”r”,encoding=”utf8″);
if tmp:
print(“jsMtmp”);
f = open(“manifest.json”,”w”,encoding=”utf8″);
f.write(tmp.read());
f.close();
tmp.close();
except Exception as e:
print(” jsMtmp is not exist”)

os.system(“layacmd resourceVersion -i js -o . -n “+myver);
f = open(“.record”,”r”,encoding=”utf8″);
s = f.read();
sm = s[s.index(“<file”):s.index(“</manifest></record>”)]

f.seek(0);
tmp = open(“jsTmp”,”w+”,encoding=”utf8″);
tmp.write(s);
tmp.close();

f.close();
s1=s1+sm;
mani = open(“manifest.json”,encoding=”utf8″);
m = mani.read();
mm = m[m.index(‘”‘):m.index(“}”)];

mani.seek(0);
tmp = open(“jsMTmp”,”w+”,encoding=”utf8″);
tmp.write(m);
tmp.close();

mani.close();
m1= m1+mm+”,”;
”’
end
”’
try:
tmp = open(“resTmp”,”r”,encoding=”utf8″);
if tmp:
print(“resTmp”);
f = open(“.record”,”w”,encoding=”utf8″);
f.write(tmp.read());
f.close();
tmp.close();
except Exception as e:
print(” resTmp is not exist”)

try:

tmp = open(“resMTmp”,”r”,encoding=”utf8″);
if tmp:
print(“resMTmp”);
f = open(“manifest.json”,”w”,encoding=”utf8″);
f.write(tmp.read());
f.close();
tmp.close();
except Exception as e:
print(” resMTmp is not exist”)

os.system(“layacmd resourceVersion -i res -o . -n “+myver);
f = open(“.record”,”r”,encoding=”utf8″);
s = f.read();
f.close();

tmp = open(“resTmp”,”w+”,encoding=”utf8″);
tmp.write(s);
tmp.close();

s2 = s[s.index(“<file”):]
s3 = s1+s2
f = open(“.record”,”w”,encoding=”utf8″);
f.write(s3);
f.close();

mani = open(“manifest.json”,encoding=”utf8″);
m = mani.read();
m2 = m[m.index(‘”‘):]
mani.close();
m3 = m1+m2

tmp = open(“resMTmp”,”w+”,encoding=”utf8″);
tmp.write(m);
tmp.close();

mani = open(“manifest.json”,”w”,encoding=”utf8″);
mani.write(m3);
mani.close();

发表评论

电子邮件地址不会被公开。 必填项已用*标注