Fixed bugs

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2021-04-18 14:14:59 +00:00
parent 3f74daf555
commit 79e9102424

View file

@ -167,15 +167,16 @@ while running:
for part in os.listdir(input_dir):
#run("rm -f " + output + "/" + part + "/" + area_major + "/" + area + ".txz", shell=True)
run("mkdir -p " + tmp_dir + "/" + area)
# If there is an archive, we need to extract it first and remove old data
if os.path.exists(output + "/" + part + "/" + area_major + "/" + area + ".txz"):
run("bash -c 'cd " + tmp_dir + "/" + area + " && tar -xf " + output + "/" + part + "/" + area_major + "/" + area + ".txz && rm *" + name + "*'")
run("bash -c 'cd " + tmp_dir + " && tar -xf " + output + "/" + part + "/" + area_major + "/" + area + ".txz && rm " + area + "/*" + name + "*'", shell=True)
else:
run("mkdir -p " + tmp_dir + "/" + area, shell=True)
# If there's new scenery copy it into the tmp dir
if os.path.exists(input_dir + "/" + part + "/" + area_major + "/" + area + "/" + name + ".stg"):
run("cp " + input_dir + "/" + part + "/" + area_major + "/" + area + "/*" + name + "* " + tmp_dir + "/" + area + "/")
run("cp " + input_dir + "/" + part + "/" + area_major + "/" + area + "/*" + name + "* " + tmp_dir + "/" + area + "/", shell=True)
# If the scenery is not empty, package it
if os.listdir(tmp_dir + "/" + area):
@ -190,7 +191,7 @@ while running:
update_index(output, part, area, area_major)
# Clean up
run("rm -r " + tmp_dir + "/" + area)
run("rm -r " + tmp_dir + "/" + area, shell=True)
print("Packaging " + name + " done")