Skip to content

Commit

Permalink
Merge pull request #972 from cstadler333/patch-1
Browse files Browse the repository at this point in the history
allow only second argument
  • Loading branch information
giedreblekaite authored Dec 6, 2024
2 parents 71d5c85 + 62522c6 commit 4b0811a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions commands/web-searches/google-maps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
first_argument=${1// /+}
second_argument=${2// /+}

if [ "$1" = "" ]; then
open "https://www.google.com/maps"
elif [ "$2" = "" ]; then
open "https://www.google.com/maps/search/$first_argument"
if [ "$1" != "" ]; then
if [ "$2" = "" ]; then
open "https://www.google.com/maps/dir/?api=1&origin=$first_argument"
else
open "https://www.google.com/maps/dir/?api=1&origin=$first_argument&destination=$second_argument"
fi
elif [ "$1" = "" ] && [ "$2" != "" ]; then
open "https://www.google.com/maps/dir/?api=1&origin=Current+Location&destination=$second_argument"
else
open "https://www.google.com/maps/dir/$first_argument/$second_argument"
open "https://www.google.com/maps"
fi

0 comments on commit 4b0811a

Please sign in to comment.