update
This commit is contained in:
parent
045864495f
commit
757921be5b
4 changed files with 94 additions and 29 deletions
16
lib/make.rb
16
lib/make.rb
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue