Skip to content

Commit 84e804e

Browse files
committed
use more precise matching for group detection
1 parent 343b1a8 commit 84e804e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/build_container

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if [ $NEED_SUDO -eq 0 ]; then
3636
FAKEROOT=--fakeroot
3737
echo "Using fakeroot"
3838
else
39-
if [[ ! -z "$GITHUB_RUN_ID" || `groups` == *"sudo"* || `groups` == *"wheel"* ]]; then
39+
if [[ ! -z "$GITHUB_RUN_ID" || $(groups) =~ (^|[[:space:]])(sudo|wheel)([[:space:]]|$) ]]; then
4040
# user has sudo permission
4141
SUDO=sudo
4242
FAKEROOT=""

0 commit comments

Comments
 (0)