Files
Digpkg/src/util.py

16 lines
484 B
Python
Raw Normal View History

2026-01-19 07:03:51 +11:00
import os, sys
from rich import print
def check_ground_libs_path():
# ensure the GROUND_LIBS var is set
if not os.getenv("GROUND_LIBS"):
2026-01-20 07:47:15 +11:00
print("[d]digpkg: the [i]GROUND_LIBS[/] environment variable is not set, defaulting to /usr/lib/ground/")
2026-01-19 07:03:51 +11:00
os.environ["GROUND_LIBS"] = "/usr/lib/ground/"
def check_sudo():
# check if we are sudo
if os.getuid() != 0:
print("[b red]digpkg: that command requires sudo to run[/]")
sys.exit(1)