From 8a73879ca5b32f0000cb509699696b5618bc6632 Mon Sep 17 00:00:00 2001 From: vapao Date: Mon, 6 Sep 2021 22:45:55 +0800 Subject: [PATCH] fix issue --- spug_api/tools/migrate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spug_api/tools/migrate.py b/spug_api/tools/migrate.py index ed08a944..3f2a6a93 100644 --- a/spug_api/tools/migrate.py +++ b/spug_api/tools/migrate.py @@ -9,6 +9,7 @@ django.setup() from django.conf import settings +import subprocess import shutil import sys import os @@ -16,8 +17,11 @@ if __name__ == '__main__': version = sys.argv[1] - if version < 'v3.0.1-beta.8': + 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目录迁移失败,请联系官方人员')