This commit is contained in:
Artur Gurgul1 2025-08-06 10:17:48 +02:00
parent 045864495f
commit 757921be5b
4 changed files with 94 additions and 29 deletions

View file

@ -123,6 +123,12 @@ module Make
"#{ENV["HOME"]}/.cache/dat/repo/#{@name}.git"
end
def download_path
require 'addressable/uri'
uri = Addressable::URI.parse(archive.url)
File.join("#{ENV["HOME"]}/.cache/dat/downloads/", uri.domain, uri.path)
end
def to_s
vars = instance_variables.map do |var|
"#{var.to_s.delete('@')}: #{instance_variable_get(var).inspect}"
@ -184,10 +190,16 @@ module Make
end
def download_and_extract
archive = @context.archive
# gem install addressable
archive = @context.archive
puts @context.download_path
puts archive
exit -1
require 'archive'
Archive.download_file(@context.archive.url, @context.download_path)
Archive.extract(@context.download_path, @cwd)
end
def checkout