You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
509 B
25 lines
509 B
#!/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 |