1
0
mirror of https://github.com/seejohnrun/haste-client.git synced 2026-02-10 09:31:33 +00:00

[UTI-2583] Adapt haste-client to the new API usage rules

This commit is contained in:
Yusuf Yilmaz
2023-01-12 11:48:06 +01:00
parent 45ce09bc88
commit 478c7f24b3
4 changed files with 117 additions and 86 deletions
+3 -5
View File
@@ -6,6 +6,8 @@ module Haste
def initialize
@uploader = Uploader.new(
ENV['HASTE_SERVER'],
ENV['HASTE_SERVER_TOKEN'],
ENV['HASTE_SHARE_SERVER'],
ENV['HASTE_USER'],
ENV['HASTE_PASS'],
ENV['HASTE_SSL_CERTS'])
@@ -20,11 +22,7 @@ module Haste
key = @uploader.upload_raw STDIN.readlines.join
end
# Put together a URL
if ARGV.include?('--raw')
url = "#{@uploader.server_url}/raw/#{key}"
else
url = "#{@uploader.server_url}/#{key}"
end
url = "#{@uploader.share_server_url}/share/#{key}"
# And write data out
if STDOUT.tty?
STDOUT.puts url