mirror of
https://github.com/seejohnrun/haste-client.git
synced 2025-12-23 12:01:29 +00:00
Use puts on tty?, print on non-tty?
This is so that there isn't a newline when doing something like: `cat something | haste | pbcopy`
This commit is contained in:
@@ -23,7 +23,8 @@ module Haste
|
||||
response = http.post '/documents', input
|
||||
if response.is_a?(Net::HTTPOK)
|
||||
data = JSON.parse(response.body)
|
||||
STDOUT.puts "#{server}/#{data['key']}"
|
||||
method = STDOUT.tty? ? :puts : :print
|
||||
STDOUT.send method, "#{server}/#{data['key']}"
|
||||
else
|
||||
STDERR.puts "failure uploading: #{response.code}"
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module Haste
|
||||
|
||||
VERSION = '0.0.4'
|
||||
VERSION = '0.0.5'
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user