Skip to content

Commit 3a45338

Browse files
committed
Refactor
1 parent 6380465 commit 3a45338

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

resources/scripts/php.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ echo ""
3232

3333
# Attempt to adjust permissions without priviledge elevation
3434
if ! chown -R "$USER": . 2>/dev/null; then
35+
CHOWN_ERROR=true
3536

3637
# Check for privilege elevation tools (doas or sudo)
3738
if command -v doas &>/dev/null; then
@@ -43,16 +44,13 @@ if ! chown -R "$USER": . 2>/dev/null; then
4344
fi
4445

4546
# Attempt to adjust permissions with priviledge elevation
46-
CHOWN_ERROR=false
4747
if [ -n "$SUDO" ]; then
4848
echo -e "${BOLD}Attempting to adjust permissions with elevated privileges.${NC}"
4949
echo -e "${BOLD}Please provide your password so we can make some final adjustments to your application's permissions.${NC}"
5050
echo ""
51-
if ! $SUDO chown -R "$USER": . 2>/dev/null; then
52-
CHOWN_ERROR=true
51+
if $SUDO chown -R "$USER": . 2>/dev/null; then
52+
CHOWN_ERROR=false
5353
fi
54-
else
55-
CHOWN_ERROR=true
5654
fi
5755

5856
# If applicable, print permissions adjustment error and exit

0 commit comments

Comments
 (0)