Skip to content

Commit

Permalink
avoid using curl when downloading ocm
Browse files Browse the repository at this point in the history
  • Loading branch information
akostadinov committed Jan 23, 2021
1 parent 6e0777e commit a7355e0
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/launchers/o_c_m_cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,14 @@ def download_ocm_cli
raise "Unsupported OS"
end
end
#doesn't work
#File.open('/tmp/ocm', 'wb') do |file|
# @result = Http.get(url: url) do |chunk|
# file.write chunk
# end
#end
shell("curl -L #{url} -o /tmp/ocm")
File.chmod(0775, '/tmp/ocm')
return '/tmp/ocm'
ocm_path = File.join(Host.localhost.workdir, 'ocm')
File.open(ocm_path, 'wb') do |file|
@result = Http.get(url: url, raise_on_error: true) do |chunk|
file.write chunk
end
end
File.chmod(0775, ocm_path)
return ocm_path
end

def shell(cmd, output = nil)
Expand Down

0 comments on commit a7355e0

Please sign in to comment.