diff options
Diffstat (limited to 'scripts/build/common-functions')
-rw-r--r-- | scripts/build/common-functions | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/build/common-functions b/scripts/build/common-functions index 6d810d73..c964419f 100644 --- a/scripts/build/common-functions +++ b/scripts/build/common-functions @@ -30,4 +30,13 @@ function get_git_hash() { else echo "${commit_id:0:7}" fi +} + +function with_sudo() { + echo "Checking sudo $@" + if [[ $(whoami) != "root" ]]; then + sudo "$@" + else + "$@" + fi } \ No newline at end of file |