forked from treehouse/mastodon
Add support for multiple source files per pack
parent
9f763b5b79
commit
f3b9a2b590
|
@ -20,7 +20,7 @@ module ThemingConcern
|
||||||
end
|
end
|
||||||
|
|
||||||
def valid_pack_data?(data, pack_name)
|
def valid_pack_data?(data, pack_name)
|
||||||
data['pack'].is_a?(Hash) && [String, Hash].any? { |c| data['pack'][pack_name].is_a?(c) }
|
data['pack'].is_a?(Hash) && data['pack'][pack_name].present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def nil_pack(data)
|
def nil_pack(data)
|
||||||
|
|
|
@ -16,10 +16,16 @@ function reducePacks (data, into = {}) {
|
||||||
const pack = data.pack[entry];
|
const pack = data.pack[entry];
|
||||||
if (!pack) continue;
|
if (!pack) continue;
|
||||||
|
|
||||||
const packFile = typeof pack === 'string' ? pack : pack.filename;
|
let packFiles = [];
|
||||||
|
if (typeof pack === 'string')
|
||||||
|
packFiles = [pack];
|
||||||
|
else if (Array.isArray(pack))
|
||||||
|
packFiles = pack;
|
||||||
|
else
|
||||||
|
packFiles = [pack.filename];
|
||||||
|
|
||||||
if (packFile) {
|
if (packFiles) {
|
||||||
into[data.name ? `flavours/${data.name}/${entry}` : `core/${entry}`] = resolve(data.pack_directory, packFile);
|
into[data.name ? `flavours/${data.name}/${entry}` : `core/${entry}`] = packFiles.map(packFile => resolve(data.pack_directory, packFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue