diff --git a/spug_api/spug/settings.py b/spug_api/spug/settings.py index 48452b45..a89d87a1 100644 --- a/spug_api/spug/settings.py +++ b/spug_api/spug/settings.py @@ -131,7 +131,7 @@ re.compile('/apis/.*'), ) -SPUG_VERSION = 'v3.0.1-beta.9' +SPUG_VERSION = 'v3.0.1-beta.10' # override default config try: diff --git a/spug_api/tools/migrate.py b/spug_api/tools/migrate.py index aa7de5b9..97be6b6e 100644 --- a/spug_api/tools/migrate.py +++ b/spug_api/tools/migrate.py @@ -13,11 +13,30 @@ import shutil import sys import os +import re + + +class Version: + def __init__(self, version): + self.version = re.sub('[^0-9.]', '', version).split('.') + + def __gt__(self, other): + if not isinstance(other, Version): + raise TypeError('required type Version') + for v1, v2 in zip(self.version, other.version): + if int(v1) == int(v2): + continue + elif int(v1) > int(v2): + return True + else: + return False + return False if __name__ == '__main__': - version = sys.argv[1] - if version <= 'v3.0.2': + old_version = Version(sys.argv[1]) + now_version = Version(settings.SPUG_VERSION) + if old_version <= Version('v3.0.2'): old_path = os.path.join(settings.BASE_DIR, 'repos') new_path = os.path.join(settings.REPOS_DIR) if not os.path.exists(new_path): diff --git a/spug_web/src/libs/index.js b/spug_web/src/libs/index.js index e8324f1a..384671e5 100644 --- a/spug_web/src/libs/index.js +++ b/spug_web/src/libs/index.js @@ -10,4 +10,4 @@ export * from './functools'; export * from './router'; export const http = _http; export const history = _history; -export const VERSION = 'v3.0.1-beta.9'; +export const VERSION = 'v3.0.1-beta.10';