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]