We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 71d5c85 + 62522c6 commit 4b0811aCopy full SHA for 4b0811a
commands/web-searches/google-maps.sh
@@ -14,10 +14,14 @@
14
first_argument=${1// /+}
15
second_argument=${2// /+}
16
17
-if [ "$1" = "" ]; then
18
- open "https://www.google.com/maps"
19
-elif [ "$2" = "" ]; then
20
- 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
21
+ open "https://www.google.com/maps/dir/?api=1&origin=$first_argument&destination=$second_argument"
22
+ fi
23
+elif [ "$1" = "" ] && [ "$2" != "" ]; then
24
+ open "https://www.google.com/maps/dir/?api=1&origin=Current+Location&destination=$second_argument"
25
else
- open "https://www.google.com/maps/dir/$first_argument/$second_argument"
26
+ open "https://www.google.com/maps"
27
fi
0 commit comments