mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
moved version to version.txt
This commit is contained in:
parent
cc926bf5fd
commit
0fef4aa22c
@ -1,6 +1,7 @@
|
||||
include LICENSE
|
||||
include README.md
|
||||
include requirements.txt
|
||||
include fishy/version.txt
|
||||
include fishy/icon.ico
|
||||
include fishy/fishybot_logo.png
|
||||
include fishy/sound.mp3
|
||||
|
@ -1,4 +1,5 @@
|
||||
from fishy import constants
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
# this prevents importing from package while setup
|
||||
@ -7,4 +8,4 @@ def main():
|
||||
actual_main()
|
||||
|
||||
|
||||
__version__ = constants.version
|
||||
__version__ = (Path(os.path.dirname(__file__)) / "version.txt").read_text()
|
||||
|
@ -10,6 +10,3 @@ libgps = ("LibGPS", "https://cdn.esoui.com/downloads/file601/LibGPS_3_2_0.zip",
|
||||
libmapping = ("LibMapPing", "https://cdn.esoui.com/downloads/file1302/LibMapPing_2_0_0.zip", 200)
|
||||
libdl = ("LibDebugLogger", "https://cdn.esoui.com/downloads/file2275/LibDebugLogger_2_4_1.zip", 241)
|
||||
libchatmsg = ("LibChatMessage", "https://cdn.esoui.com/downloads/file2382/LibChatMessage_1_2_0.zip", 120)
|
||||
|
||||
|
||||
version = "0.5.14"
|
||||
|
@ -1,8 +1,8 @@
|
||||
import logging
|
||||
|
||||
import fishy
|
||||
from fishy.helper.auto_update import _normalize_version
|
||||
|
||||
from fishy.constants import version
|
||||
from .config import config
|
||||
|
||||
|
||||
@ -14,14 +14,14 @@ class Migration:
|
||||
@staticmethod
|
||||
def migrate():
|
||||
prev_version = _normalize_version(config.get("prev_version", "0.0.0"))
|
||||
current_version = _normalize_version(version)
|
||||
current_version = _normalize_version(fishy.__version__)
|
||||
|
||||
if current_version > prev_version:
|
||||
for v, f in migration_code:
|
||||
if prev_version < _normalize_version(v) <= current_version:
|
||||
logging.info(f"running migration for {v}")
|
||||
f()
|
||||
config.set("prev_version", version)
|
||||
config.set("prev_version", fishy.__version__)
|
||||
|
||||
|
||||
|
||||
|
1
fishy/version.txt
Normal file
1
fishy/version.txt
Normal file
@ -0,0 +1 @@
|
||||
0.5.14
|
Loading…
Reference in New Issue
Block a user