mirror of
https://codeberg.org/Mo8it/dotfiles.git
synced 2024-12-30 20:13:42 +00:00
Fancy press to exit
This commit is contained in:
parent
f6f3244e54
commit
65dc8d158d
1 changed files with 10 additions and 10 deletions
|
@ -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!")
|
||||
|
||||
|
|
Loading…
Reference in a new issue