mirror of
https://github.com/Installomator/Installomator.git
synced 2026-02-17 04:02:10 +00:00
check for root earlier when not in debug mode #617
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SmithersJr on GitHub.
When testing a new label, I test locally in debug mode first. If everything looks good there, I test locally with debug mode off before loading it up in Jamf. If I forget to run as root, I have to wait for the whole download, verification, etc. before the error,
ERROR: not running as root, exiting.It would be helpful to get that error at the beginning of the process, so I don't have to wait another 8 minutes to test. :-/
(And, also, because I'm a goober that can't remember to run it with
sudo.) :-P@samess-flowers commented on GitHub:
Would moving the check forward in the process while adding an additional debug state that does everything but install things resolve this for everyone?
DEBUG=0andDEBUG=1would work the way they currently do, but a new stateDEBUG=2(which doesn't feel properly idiomatic, but would fit the pattern) could either skip the earlier root check (the easier way to implement) or purposefully terminate where the current root check is even if the program is being run as root (which feels "cleaner" to me).@Theile commented on GitHub:
I love that the root check is so late, as I do a lot of testing with downloading, when not in DEBUG mode, just by running it without root access.
@Theile commented on GitHub:
I like that I can test a label for download and comparison of version and all, and be certain the thing is not installed. When I have Installomator.sh installed on my own system and just checking a label, it's actually very nice.
Sometimes also for testing a manual label where the variables are sent as part of the script.
I can understand it's annoying to forget to be root if you intended an installation, but at least it didn't get unintentional installed.
I could use DEBUG=1, but the result is not the same.
@acodega commented on GitHub:
I agree with @SmithersJr here, the root check should be one of the first things the script does.