Fix weird indentation issue of yaml

This commit is contained in:
Adam Stankiewicz
2020-09-06 15:08:20 +02:00
parent 57badea2dc
commit d9ee362537
9 changed files with 455 additions and 10 deletions

View File

@@ -155,7 +155,8 @@ end
def parse_remote(remote)
match = remote.match(/(?<repo>[^@:]+)(?:@(?<branch>[^:]+))?(?::(?<path>.*))?/)
[match[:repo], match[:branch] || "master", match[:path]]
dir = "tmp/" + match[:repo] + (match[:branch] ? "-#{match[:branch]}" : "")
[match[:repo], match[:branch] || "master", match[:path], dir]
end
def copy_file(package, src, dest)
@@ -179,8 +180,7 @@ def download(packages)
packages.map { |p| p["remote"] or raise "No remote for: " + p["name"] }.uniq.each_slice(20) do |remotes|
remotes.map do |remote|
Thread.new do
repo, branch, path = parse_remote(remote)
dir = "tmp/" + repo
repo, branch, path, dir = parse_remote(remote)
unless File.exist?(dir)
FileUtils.mkdir_p(dir)
url = "https://codeload.github.com/#{repo}/tar.gz/#{branch}"
@@ -321,8 +321,7 @@ def extract(packages)
output = []
packages.map do |package|
repo, branch, path = parse_remote(package["remote"])
dir = "tmp/" + repo
repo, branch, path, dir = parse_remote(package["remote"])
dirs = package.fetch("dirs", default_dirs)
ignored_dirs = package.fetch("ignored_dirs", [])
if ignored_dirs.size > 0