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 committed May 18, 2022
1 parent ee84ba8 commit f5c876e
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 f5c876e

Please sign in to comment.