mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-19 02:02:32 +01:00
droplr: convert ruby file into zsh
This commit is contained in:
parent
8648873887
commit
7a32a98ced
2 changed files with 15 additions and 13 deletions
|
|
@ -1 +1,15 @@
|
|||
alias droplr=$ZSH/plugins/droplr/droplr.rb
|
||||
# Only compatible with MacOS
|
||||
[[ "$OSTYPE" == darwin* ]] || return
|
||||
|
||||
droplr() {
|
||||
if [[ $# -eq 0 ]]; then
|
||||
echo You need to specify a parameter. >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ "$1" =~ ^http[|s]:// ]]; then
|
||||
osascript -e "tell app 'Droplr' to shorten '$1'"
|
||||
else
|
||||
open -ga /Applications/Droplr.app "$1"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue