mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-26 13:14:35 +00:00
Ask user for package install
This commit is contained in:
parent
4e28223284
commit
86317465ce
|
@ -2,9 +2,19 @@ import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from src.packages import install_packages
|
from src.packages import install_packages
|
||||||
|
from src.util.user import Input, Print
|
||||||
|
|
||||||
|
|
||||||
if os.geteuid() != 0:
|
if os.geteuid() != 0:
|
||||||
sys.exit("Please run this program as root user")
|
sys.exit("Please run this program as root user")
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if Input.yes_no("Do you wish to perform package install (from `packages.yaml`)?"):
|
||||||
install_packages()
|
install_packages()
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
main()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
Print.err("User cancelled (KeyboardInterrupt)")
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Print:
|
||||||
|
|
||||||
def err(text: str) -> None:
|
def err(text: str) -> None:
|
||||||
"""Print syntax for error"""
|
"""Print syntax for error"""
|
||||||
print(f"{Color.RED} !! {text}{Color.RESET}")
|
print(f"\n{Color.RED} !! {text}{Color.RESET}")
|
||||||
|
|
||||||
def cancel(text: str) -> None:
|
def cancel(text: str) -> None:
|
||||||
"""Print syntax for cancellation"""
|
"""Print syntax for cancellation"""
|
||||||
|
|
Loading…
Reference in a new issue