Skip to content

Commit 3e2789c

Browse files
Fix failing extraction of secured domain check
Co-Authored-By: Mateus Junges <[email protected]>
1 parent 374eaa0 commit 3e2789c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

valet

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ then
7070
fi
7171
done
7272

73-
# Lowercase the host to match the rest of our domains are looked up
73+
# Lowercase the host to match how the rest of our domains are looked up
7474
HOST=$(echo "$HOST" | tr '[:upper:]' '[:lower:]')
7575
TLD=$("$PHP" "$DIR/cli/valet.php" tld)
76-
SECURED=$(grep --quiet --no-messages 443 ~/.config/valet/Nginx/$HOST*)
76+
$(grep --quiet --no-messages 443 ~/.config/valet/Nginx/$HOST*)
77+
SECURED=$?
7778

7879
if [[ $SHARETOOL = "ngrok" ]]
7980
then
@@ -88,8 +89,7 @@ then
8889
fi
8990

9091
# Decide the correct PORT: uses 60 for secure, else 80
91-
if $SECURED
92-
then
92+
if [[ $SECURED -eq 0 ]]; then
9393
PORT=60
9494
else
9595
PORT=80
@@ -104,8 +104,7 @@ then
104104

105105
# expose
106106
# Decide the correct PORT: uses 443 for secure, else 80
107-
if $SECURED
108-
then
107+
if [[ $SECURED -eq 0 ]]; then
109108
PORT=443
110109
else
111110
PORT=80
@@ -118,8 +117,7 @@ then
118117
elif [[ $SHARETOOL = "cloudflared" ]]
119118
then
120119
# cloudflared
121-
if $SECURED
122-
then
120+
if [[ $SECURED -eq 0 ]]; then
123121
SCHEME="https"
124122
else
125123
SCHEME="http"

0 commit comments

Comments
 (0)