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