1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

Apply suggestions from code review

Co-Authored-By: Matt Stauffer <mattstauffer@users.noreply.github.com>
This commit is contained in:
Chris Brown
2019-12-10 23:17:49 -05:00
committed by GitHub
parent 998e4c32df
commit 99f0bd19c5

10
valet
View File

@@ -31,7 +31,7 @@ fi
# process to retrieve the live Ngrok tunnel URL in the background.
if [[ "$1" = "share" ]]
then
# check for parameters to passthru to ngrok (they start with '-' or '--')
# Check for parameters to pass through to ngrok (these will start with '-' or '--')
PARAMS=${3:-$2}
if [[ ${PARAMS:0:1} != '-' ]]; then
PARAMS=''
@@ -39,18 +39,18 @@ then
HOST="${PWD##*/}"
# check for custom domain passed through to the share command ($2 w/o '-' prefix)
# Check for custom domain passed through to the share command ($2 w/o '-' prefix)
if [[ ${2:0:1} != '-' ]]; then
# if not blank and is a link or is the cwd use it
# If not blank and is a link, or is the cwd, use it
if [[ ! -z $2 && (-L ~/.config/valet/Sites/$2 || $2 == $HOST) ]]; then
HOST=$2
CLIHOST=$2
fi
fi
# if no custom domain passed then check if there's a linked site for cwd
# If no custom domain passed, then check if there's a linked site for cwd
if [[ -z $CLIHOST ]]; then
# find the first linked site for the current dir, if one exists
# Find the first linked site for the current dir, if one exists
for linkname in ~/.config/valet/Sites/*; do
if [[ "$(readlink $linkname)" = "$PWD" ]]
then