From e72eb4b31f6b357d1dc571fdaa71d36492325660 Mon Sep 17 00:00:00 2001 From: shim_ <> Date: Thu, 13 Sep 2018 21:25:25 +0200 Subject: [PATCH] resume setup if possible --- scripts/upgrade.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade.py b/scripts/upgrade.py index 0593016..82cc1cc 100755 --- a/scripts/upgrade.py +++ b/scripts/upgrade.py @@ -75,9 +75,12 @@ def install_command(url): tmp = tempfile.mkdtemp() if call(["/bin/sh", "-c", 'cd %s; curl %s | tar xzv' % (tmp, url)]) == 0: for f in os.listdir(tmp): + dest = os.path.join(seaf_home, os.path.basename(f)) if len(re.findall(version_re, f)) > 0: - dest = os.path.join(seaf_home, os.path.basename(f)) - shutil.move(os.path.join(tmp,f), dest) + if not os.path.exists(dest): + shutil.move(os.path.join(tmp,f), dest) + else: + print("Found previous installation, resuming setup") current = current_version() target_version = ''.join(re.findall(version_re,dest)) if len(current) == 1: current = current[0]