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 Jan 11, 2022
1 parent 9b795db commit 94b778c
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 @@ -17,7 +17,7 @@ REPR_MIRROR_URL_PATTERN='http:\/\/packages.trafficmanager.net\/debian'

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 94b778c

Please sign in to comment.