mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
improve check if we are root already - in scripts/get
$EUID is readonly, so it should be save to test against it. Thanks for the tip @thomastaylor312 !
This commit is contained in:
parent
974c4b67c7
commit
8eace382f9
1 changed files with 1 additions and 1 deletions
|
|
@ -50,7 +50,7 @@ initOS() {
|
|||
runAsRoot() {
|
||||
local CMD="$*"
|
||||
|
||||
if ! whoami | egrep -q '^root$'; then
|
||||
if [ $EUID -ne 0 ]; then
|
||||
CMD="sudo $CMD"
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue