From 7b76bd443db609d969671d66c2ee8b0b593d74ad Mon Sep 17 00:00:00 2001 From: vapao Date: Mon, 6 Sep 2021 23:01:18 +0800 Subject: [PATCH] fix issue --- spug_api/tools/migrate.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spug_api/tools/migrate.py b/spug_api/tools/migrate.py index 3f2a6a93..337d8ccc 100644 --- a/spug_api/tools/migrate.py +++ b/spug_api/tools/migrate.py @@ -18,10 +18,11 @@ if __name__ == '__main__': version = sys.argv[1] if version <= 'v3.0.1-beta.8': - print('执行 v3.0.1-beta.8 repos目录迁移') old_path = os.path.join(settings.BASE_DIR, 'repos') new_path = os.path.join(settings.REPOS_DIR) - shutil.move(old_path, new_path) - task = subprocess.Popen(f'cd {settings.BASE_DIR} && git checkout -- repos', shell=True) - if task.wait() != 0: - print('repos目录迁移失败,请联系官方人员') + if not os.path.exists(new_path): + print('执行 v3.0.1-beta.8 repos目录迁移') + shutil.move(old_path, new_path) + task = subprocess.Popen(f'cd {settings.BASE_DIR} && git checkout -- repos', shell=True) + if task.wait() != 0: + print('repos目录迁移失败,请联系官方人员')