Fix errors on interruptions

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2021-03-27 18:50:44 +00:00
parent 9c4354a3e8
commit a56de2ad5a

View file

@ -91,12 +91,15 @@ if api != None and api_token == None:
sys.exit(1) sys.exit(1)
def cleanup(): def cleanup():
if os.path.isfile("projects/worldbuild-" + name + "/osm2city-exceptions.log"): if name != None:
run("mv projects/worldbuild-" + name + "/osm2city-exceptions.log projects/worldbuild/output/error/" + name + "-" + strftime("%Y%m%d-%H%M") + ".exceptions.log", shell=True) if os.path.isfile("projects/worldbuild-" + name + "/osm2city-exceptions.log"):
run("mv projects/worldbuild-" + name + "/osm2city-exceptions.log projects/worldbuild/output/error/" + name + "-" + strftime("%Y%m%d-%H%M") + ".exceptions.log", shell=True)
run("rm -rf projects/worldbuild-" + name, shell=True) run("rm -rf projects/worldbuild-" + name, shell=True)
name = None
build = None build = None
name = None
try: try:
running = True running = True
while running: while running: