summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/droplr/droplr.plugin.zsh16
-rwxr-xr-xplugins/droplr/droplr.rb12
2 files changed, 15 insertions, 13 deletions
diff --git a/plugins/droplr/droplr.plugin.zsh b/plugins/droplr/droplr.plugin.zsh
index 2a2ec227c..296a8b98b 100644
--- a/plugins/droplr/droplr.plugin.zsh
+++ b/plugins/droplr/droplr.plugin.zsh
@@ -1 +1,15 @@
-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
+}
diff --git a/plugins/droplr/droplr.rb b/plugins/droplr/droplr.rb
deleted file mode 100755
index 00300198e..000000000
--- a/plugins/droplr/droplr.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/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