0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-19 04:01:21 +02:00
ohmyzsh/plugins/droplr/droplr.rb
2016-09-02 20:26:14 +02:00

25 lines
No EOL
509 B
Ruby
Executable file

#!/usr/bin/env ruby
#
# droplr
# Fabio Fernandes | http://fabiofl.me
#
# Use Droplr from the comand line to upload files and shorten links.
#
# Examples:
#
# droplr ./path/to/file/
# droplr http://example.com
#
# This needs Droplr.app to be installed and loged in.
# Also, Mac only.
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