summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Fernandes <im.fabiofl@gmail.com>2013-07-13 05:27:37 -0300
committerMarc Cornellà <marc.cornella@live.com>2016-09-02 20:26:14 +0200
commit1af4e9c521d82068871956dc4cf172a262827520 (patch)
tree80fcb0f87ca9947d19d4b1faa034b5874cb06cac
parent3c8a33364f64975970839eeded921c3ed85ad507 (diff)
downloadzsh-1af4e9c521d82068871956dc4cf172a262827520.tar.gz
zsh-1af4e9c521d82068871956dc4cf172a262827520.tar.bz2
zsh-1af4e9c521d82068871956dc4cf172a262827520.zip
Add Droplr plugin
-rw-r--r--plugins/droplr/droplr.plugin.zsh3
-rwxr-xr-xplugins/droplr/droplr.rb25
2 files changed, 28 insertions, 0 deletions
diff --git a/plugins/droplr/droplr.plugin.zsh b/plugins/droplr/droplr.plugin.zsh
new file mode 100644
index 000000000..a20ca9368
--- /dev/null
+++ b/plugins/droplr/droplr.plugin.zsh
@@ -0,0 +1,3 @@
+#!/bin/zsh
+
+alias droplr=$ZSH/plugins/droplr/droplr.rb \ No newline at end of file
diff --git a/plugins/droplr/droplr.rb b/plugins/droplr/droplr.rb
new file mode 100755
index 000000000..38751dfcb
--- /dev/null
+++ b/plugins/droplr/droplr.rb
@@ -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 \ No newline at end of file