mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
Add Droplr plugin
This commit is contained in:
parent
3c8a33364f
commit
1af4e9c521
2 changed files with 28 additions and 0 deletions
3
plugins/droplr/droplr.plugin.zsh
Normal file
3
plugins/droplr/droplr.plugin.zsh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
alias droplr=$ZSH/plugins/droplr/droplr.rb
|
25
plugins/droplr/droplr.rb
Executable file
25
plugins/droplr/droplr.rb
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/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
|
Loading…
Reference in a new issue