Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
7a32a98c
Commit
7a32a98c
authored
Sep 02, 2016
by
Marc Cornellà
Browse files
droplr: convert ruby file into zsh
parent
86488738
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/droplr/droplr.plugin.zsh
View file @
7a32a98c
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
}
plugins/droplr/droplr.rb
deleted
100755 → 0
View file @
86488738
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment