Skip to content

Commit

Permalink
[build] docker-sonic-mgmt replace USER by whoami (#9702)
Browse files Browse the repository at this point in the history
  • Loading branch information
liushilongbuaa authored and judyjoseph committed May 2, 2022
1 parent a55ba09 commit 482f45e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sonic-build-hooks/scripts/buildinfo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DPKG_INSTALLTION_LOCK_FILE=/tmp/.dpkg_installation.lock

URL_PREFIX=$(echo "${PACKAGE_URL_PREFIX}" | sed -E "s#(//[^/]*/).*#\1#")

if [ $USER != 'root' ] && [ -n $(which sudo) ];then
if [ "$(whoami)" != "root" ] && [ -n "$(which sudo)" ];then
SUDO=sudo
else
SUDO=''
Expand Down

0 comments on commit 482f45e

Please sign in to comment.