[FEAT] Added Automatic Flexibility for Regular and Root User - #284
[FEAT] Added Automatic Flexibility for Regular and Root User#284rhuanpk wants to merge 1 commit into
Conversation
Raymo111
left a comment
There was a problem hiding this comment.
Review — Approve with nits
What it does: Introduces a SUDO variable set to sudo for normal users but unset when running as root ([ "$UID" -eq 0 ]), so make install runs directly as root instead of calling sudo (which may be absent in a root-only container).
Correctness: Root detection is sound — the operand is quoted and $UID is reliably populated under the #!/bin/bash shebang. Leaving $SUDO make install unquoted is the right idiom here: unset → it disappears via word-splitting yielding make install; set → sudo make install. (ShellCheck's SC2086 is a false positive in this pattern; quoting it would break the root case.) Non-root behavior is unchanged; the only change is dropping sudo when already root, which is a strict improvement.
Nits:
- Empty PR description — a one-line rationale ("skip sudo when already root so it works in root-only containers") would help.
- Optional:
[ "$(id -u)" -eq 0 ]would make the check POSIX-portable if the script is ever run under a non-bashsh; not needed while the shebang stays bash.
Recommendation: Safe to merge — small, correct, behavior-improving; just add a one-line description.
No description provided.