Fix regex for optional http(s), and variable reference inside osascript.

This commit is contained in:
kennyklee 2016-10-17 01:00:14 -07:00 committed by Marc Cornellà
parent cff228e342
commit 5cd7ad38cb
1 changed files with 2 additions and 2 deletions

View File

@ -7,8 +7,8 @@ droplr() {
return 1
fi
if [[ "$1" =~ ^http[|s]:// ]]; then
osascript -e "tell app 'Droplr' to shorten '$1'"
if [[ "$1" =~ ^https?:// ]]; then
osascript -e 'tell app "Droplr" to shorten "'"$1"'"'
else
open -ga /Applications/Droplr.app "$1"
fi