mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-26 01:57:26 +08:00
Compare commits
No commits in common. "b706a919172955e16a1ab97f36a95b9ee4d9f1dc" and "5ffc0d036c587741fd25092e7809dad2b00b3677" have entirely different histories.
b706a91917
...
5ffc0d036c
@ -17,7 +17,7 @@ function title {
|
|||||||
: ${2=$1}
|
: ${2=$1}
|
||||||
|
|
||||||
case "$TERM" in
|
case "$TERM" in
|
||||||
cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm)
|
cygwin|xterm*|putty*|rxvt*|konsole*|ansi)
|
||||||
print -Pn "\e]2;$2:q\a" # set window name
|
print -Pn "\e]2;$2:q\a" # set window name
|
||||||
print -Pn "\e]1;$1:q\a" # set tab name
|
print -Pn "\e]1;$1:q\a" # set tab name
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
# CloudApp plugin
|
# CloudApp plugin
|
||||||
|
|
||||||
## The CloudApp API is deprecated, so the plugin will be removed shortly
|
|
||||||
|
|
||||||
[CloudApp](https://www.getcloudapp.com) brings screen recording, screenshots, and GIF creation to the cloud, in an easy-to-use enterprise-level app. The CloudApp plugin allows you to upload a file to your CloadApp account from the command line.
|
[CloudApp](https://www.getcloudapp.com) brings screen recording, screenshots, and GIF creation to the cloud, in an easy-to-use enterprise-level app. The CloudApp plugin allows you to upload a file to your CloadApp account from the command line.
|
||||||
|
|
||||||
To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file:
|
To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file:
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
print -Pn "%F{yellow}"
|
alias cloudapp="${0:a:h}/cloudapp.rb"
|
||||||
print "[oh-my-zsh] The CloudApp API no longer works, so the cloudapp plugin will"
|
|
||||||
print "[oh-my-zsh] be removed shortly. Please remove it from your plugins list."
|
# Ensure only the owner can access the credentials file
|
||||||
print -Pn "%f"
|
if [[ -f ~/.cloudapp ]]; then
|
||||||
|
chmod 600 ~/.cloudapp
|
||||||
|
fi
|
||||||
|
|||||||
60
plugins/cloudapp/cloudapp.rb
Executable file
60
plugins/cloudapp/cloudapp.rb
Executable file
@ -0,0 +1,60 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
#
|
||||||
|
# cloudapp
|
||||||
|
# Zach Holman / @holman
|
||||||
|
#
|
||||||
|
# Uploads a file from the command line to CloudApp, drops it into your
|
||||||
|
# clipboard (on a Mac, at least).
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
#
|
||||||
|
# cloudapp drunk-blake.png
|
||||||
|
#
|
||||||
|
# This requires Aaron Russell's cloudapp_api gem:
|
||||||
|
#
|
||||||
|
# gem install cloudapp_api
|
||||||
|
#
|
||||||
|
# Requires you set your CloudApp credentials in ~/.cloudapp as a simple file of:
|
||||||
|
#
|
||||||
|
# email
|
||||||
|
# password
|
||||||
|
|
||||||
|
require 'rubygems'
|
||||||
|
begin
|
||||||
|
require 'cloudapp_api'
|
||||||
|
rescue LoadError
|
||||||
|
puts "You need to install cloudapp_api: gem install cloudapp_api"
|
||||||
|
exit!(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
config_file = "#{ENV['HOME']}/.cloudapp"
|
||||||
|
unless File.exist?(config_file)
|
||||||
|
puts "You need to type your email and password (one per line) into "+
|
||||||
|
"`~/.cloudapp`"
|
||||||
|
exit!(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
email,password = File.read(config_file).split("\n")
|
||||||
|
|
||||||
|
class HTTParty::Response
|
||||||
|
# Apparently HTTPOK.ok? IS NOT OKAY WTFFFFFFFFFFUUUUUUUUUUUUUU
|
||||||
|
# LETS MONKEY PATCH IT I FEEL OKAY ABOUT IT
|
||||||
|
def ok? ; true end
|
||||||
|
end
|
||||||
|
|
||||||
|
if ARGV[0].nil?
|
||||||
|
puts "You need to specify a file to upload."
|
||||||
|
exit!(1)
|
||||||
|
end
|
||||||
|
|
||||||
|
CloudApp.authenticate(email,password)
|
||||||
|
url = CloudApp::Item.create(:upload, {:file => ARGV[0]}).url
|
||||||
|
|
||||||
|
# Say it for good measure.
|
||||||
|
puts "Uploaded to #{url}."
|
||||||
|
|
||||||
|
# Get the embed link.
|
||||||
|
url = "#{url}/#{ARGV[0].split('/').last}"
|
||||||
|
|
||||||
|
# Copy it to your (Mac's) clipboard.
|
||||||
|
`echo '#{url}' | tr -d "\n" | pbcopy`
|
||||||
Loading…
Reference in New Issue
Block a user