Skip to content

Commit 325fba1

Browse files
kcaisleyvvbandeira
andcommitted
Add +x default value to avoid case when variable is set to empty string,
or is undefined Co-authored-by: Vitor Bandeira <[email protected]> Signed-off-by: Kennedy Caisley <[email protected]>
1 parent bbed7c4 commit 325fba1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

etc/DependencyInstaller.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ if [[ ! -z ${saveDepsPrefixes} ]]; then
10211021
mkdir -p "$(dirname $saveDepsPrefixes)"
10221022
echo "$CMAKE_PACKAGE_ROOT_ARGS" > $saveDepsPrefixes
10231023
# Fix permissions if running as root to allow user access
1024-
if [[ $(id -u) == 0 && ! -z "$SUDO_USER" ]]; then
1024+
if [[ $(id -u) == 0 && ! -z "${SUDO_USER+x}" ]]; then
10251025
chown "$SUDO_USER:$(id -gn "$SUDO_USER")" "$saveDepsPrefixes" 2>/dev/null || true
10261026
fi
10271027
fi

0 commit comments

Comments
 (0)