Commit 7a32a98c authored by Marc Cornellà's avatar Marc Cornellà
Browse files

droplr: convert ruby file into zsh

parent 86488738
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
}
#!/usr/bin/env ruby
if ARGV[0].nil?
puts "You need to specify a parameter."
exit!(1)
end
if ARGV[0][%r{^http[|s]://}i]
`osascript -e 'tell app "Droplr" to shorten "#{ARGV[0]}"'`
else
`open -ga /Applications/Droplr.app "#{ARGV[0]}"`
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment