Implement remote file check as Haskell command

This commit is contained in:
2023-08-17 22:07:09 +02:00
parent 6b15ccd0f5
commit fd649b66f5
7 changed files with 43 additions and 8 deletions

View File

@ -48,13 +48,7 @@ module SlackBuilder
end
def self.remote_file_exists?(url)
uri = URI hosted_sources(url)
request = Net::HTTP.new uri.host, uri.port
request.use_ssl = true
response = request.request_head uri.path
response.code.to_i == 200
`./bin/slackbuilder exists #{url}`.strip == 'True'
end
def self.download_and_deploy(uri, tarball)