Skip to content

Commit

Permalink
Added get_username function
Browse files Browse the repository at this point in the history
  • Loading branch information
mmontes11 committed May 11, 2024
1 parent 43eb5d1 commit 2768903
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ function get_user_home() {
echo $USER_HOME
}

function get_username() {
if [ -n "$SUDO_USER" ]; then
echo "$SUDO_USER"
else
echo "$(whoami)"
fi
}

function get_architecture() {
ARCH=$(uname -m)
if [ $ARCH = "x86_64" ]; then
Expand Down

0 comments on commit 2768903

Please sign in to comment.