Skip to content

Commit

Permalink
🐛 FIX: bugfix for #14
Browse files Browse the repository at this point in the history
  • Loading branch information
apolopena committed Feb 2, 2021
1 parent 4db22d4 commit 4176010
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bash/snippets/browser-functions
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,17 @@ open_preview() {
stype=$(echo "$1" | tr '[:upper:]' '[:lower:]')
local port
[ -z "$stype" ] && echo "$err Missing server type. Exactly one argument was expected." && echo $usage && return
#[ "$stype" != 'php' ] || [ "$stype" != 'apache'] && echo "$err invalid server type: $stype"
[ "$stype" == 'php' ] && port=$php_port
[ "$stype" == 'apache' ] && port=$apache_port
echo port=$port
case $stype in
"php")
port=$php_port
;;
"apache")
port=$apache_port
;;
*)
echo "$err invalid server type: $stype"
;;
esac
gp await-port $port &&
gp preview "$(gp url $port)?firstrun=1" &&
echo "Auto refreshing preview browser. Please wait 5 seconds."
Expand Down

0 comments on commit 4176010

Please sign in to comment.