From 5df6c657632fbf726429f10109cd3510cda11f6b Mon Sep 17 00:00:00 2001 From: Paul Nameless Date: Thu, 22 Apr 2021 11:12:47 +0300 Subject: [PATCH] Fix release --- make | 2 +- tg/__main__.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/make b/make index c56b48f..a2c5e09 100755 --- a/make +++ b/make @@ -28,7 +28,7 @@ case $ARG in NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{print $1 "." $2+1 "." $3}') echo New version $NEW_VERSION - sed -i '' 's|$CURRENT_VERSION|$NEW_VERSION|g' tg/__init__.py + sed -i '' "s|$CURRENT_VERSION|$NEW_VERSION|g" tg/__init__.py git add -u tg/__init__.py git commit -m "Release v$NEW_VERSION" diff --git a/tg/__main__.py b/tg/__main__.py index 3f861b1..0785d36 100644 --- a/tg/__main__.py +++ b/tg/__main__.py @@ -42,8 +42,17 @@ def run(tg: Tdlib, stdscr: window) -> None: controller.draw() +def parse_args(): + import sys + if len(sys.argv) > 1 and sys.argv[1] in ("-v", "--version"): + import tg + print("Terminal Telegram client") + print("Version:", tg.__version__) + exit(0) + def main() -> None: + parse_args() utils.cleanup_cache() tg = Tdlib( api_id=config.API_ID, @@ -63,11 +72,4 @@ def main() -> None: if __name__ == "__main__": - import sys - if len(sys.argv) > 1 and sys.argv[1] in ("-v", "--version"): - import tg - print("Terminal Telegram client") - # print("Version:", tg.__version__) - print("Version:", tg.__version__) - exit(0) main()