21 lines
537 B
Ruby
Raw Normal View History

require_relative "directory"
module UnpackStrategy
class Mercurial < Directory
using Magic
def self.can_extract?(path)
super && (path/".hg").directory?
end
private
def extract_to_dir(unpack_dir, basename:, verbose:)
system_command! "hg",
2018-11-02 17:18:07 +00:00
args: ["--cwd", path, "archive", "--subrepos", "-y", "-t", "files", unpack_dir],
env: { "PATH" => PATH.new(Formula["mercurial"].opt_bin, ENV["PATH"]) },
2018-07-24 18:43:20 +02:00
verbose: verbose
end
end
end