Add script to extract a layer from a theme
This commit is contained in:
parent
4af622575d
commit
fa50e52afc
2 changed files with 53 additions and 16 deletions
|
@ -57,22 +57,6 @@ function addArticleToPresets(layerConfig: {presets?: {title: any}[]}){
|
|||
//*/
|
||||
}
|
||||
|
||||
function extractInlineLayer(theme: LayoutConfigJson){
|
||||
for (let i = 0; i < theme.layers.length; i++){
|
||||
const layer = theme.layers[i];
|
||||
if(typeof layer === "string"){
|
||||
continue
|
||||
}
|
||||
if(layer["override"] !== undefined){
|
||||
continue
|
||||
}
|
||||
const l = <LayerConfigJson> layer
|
||||
mkdirSync("./assets/layers/"+l.id)
|
||||
writeFileSync("./assets/layers/"+l.id+"/"+l.id+".json", JSON.stringify(l, null, " "))
|
||||
theme.layers[i] = l.id
|
||||
}
|
||||
}
|
||||
|
||||
const layerFiles = ScriptUtils.getLayerFiles();
|
||||
for (const layerFile of layerFiles) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue