File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 14
14
first_argument=${1// / +}
15
15
second_argument=${2// / +}
16
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 "
17
+ if [ " $1 " != " " ]; then
18
+ if [ " $2 " = " " ]; then
19
+ open " https://www.google.com/maps/dir/?api=1&origin=$first_argument "
20
+ 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 "
21
25
else
22
- open " https://www.google.com/maps/dir/ $first_argument / $second_argument "
26
+ open " https://www.google.com/maps"
23
27
fi
You can’t perform that action at this time.
0 commit comments