Add ":file" to the list of supported sources

Signed-off-by: default avatarMikhail Zholobov <legal90@gmail.com>
parent 68c30158
......@@ -292,7 +292,7 @@ module Omnibus
val = canonicalize_source(val)
extra_keys = val.keys - [
:git, :path, :url, # fetcher types
:git, :file, :path, :url, # fetcher types
:md5, :sha1, :sha256, :sha512, # hash type - common to all fetchers
:cookie, :warning, :unsafe, :extract, # used by net_fetcher
:options, # used by path_fetcher
......@@ -303,7 +303,7 @@ module Omnibus
"only include valid keys. Invalid keys: #{extra_keys.inspect}")
end
duplicate_keys = val.keys & [:git, :path, :url]
duplicate_keys = val.keys & [:git, :file, :path, :url]
unless duplicate_keys.size < 2
raise InvalidValue.new(:source,
"not include duplicate keys. Duplicate keys: #{duplicate_keys.inspect}")
......@@ -1053,6 +1053,8 @@ module Omnibus
:url
elsif source[:git]
:git
elsif source[:file]
:file
elsif source[:path]
:path
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment