From 65dc8d158dd576e0ec1a5dc227a96a2608fe6b1e Mon Sep 17 00:00:00 2001 From: Mo8it Date: Thu, 16 Jun 2022 22:21:33 +0200 Subject: [PATCH] Fancy press to exit --- .scripts/update.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.scripts/update.py b/.scripts/update.py index cd4e25d..b1a2db0 100644 --- a/.scripts/update.py +++ b/.scripts/update.py @@ -20,7 +20,7 @@ def cap_live_lines(command, **kwargs): def press_to_exit(): - getpass("Exit") + getpass("\n<<-<>===EXIT===<>->>") def update_rpm_ostree(): @@ -40,6 +40,13 @@ def update_flatpak(): press_to_exit() +def update_cargo(): + lines = cap_live_lines("cargo install-update -a") + + if "no packages need updating" not in lines[-2].lower(): + press_to_exit() + + def update_pipx(): lines = cap_live_lines("pipx upgrade-all --include-injected") @@ -51,24 +58,17 @@ def update_nvim(): run('nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync"') -def update_cargo(): - lines = cap_live_lines("cargo install-update -a") - - if "no packages need updating" not in lines[-2].lower(): - press_to_exit() - - def main(input): if input == "rpm-ostree": update_rpm_ostree() elif input == "flatpak": update_flatpak() - elif input == "nvim": - update_nvim() elif input == "cargo": update_cargo() elif input == "pipx": update_pipx() + elif input == "nvim": + update_nvim() else: print(f"Input {input} not valid!")