Added NO_SUDO if system has no sudo (for custom modules that use sudo)

pull/5/head
Rilliat 2024-11-07 21:11:57 +03:00
parent 09a9e0b9e0
commit bd3c79346a
1 changed files with 6 additions and 1 deletions

View File

@ -16,7 +16,7 @@ from ._internal import restart
if (
getpass.getuser() == "root"
and "--root" not in " ".join(sys.argv)
and all(trigger not in os.environ for trigger in {"DOCKER", "GOORM"})
and all(trigger not in os.environ for trigger in {"DOCKER", "GOORM", "NO_SUDO"})
):
print("🚫" * 15)
print("You attempted to run Hikka on behalf of root user")
@ -25,8 +25,13 @@ if (
print("🚫" * 15)
print()
print("Type force_insecure to ignore this warning")
print("Type no_sudo if your system has no sudo (Debian vibes)")
if input("> ").lower() != "force_insecure":
sys.exit(1)
elif input("> ").lower() != 'no_sudo':
os.environ['NO_SUDO'] = '1'
print('Added NO_SUDO in your environment variables')
restart()
def deps():