ring-websites-toolbelt
Version:
Ring Publishing Platform tool to work with Ring Websites
35 lines (27 loc) • 956 B
JavaScript
const Builder = require(`./../../Builder`);
const ThemeScriptAbstract = require(`./../../ThemeScriptAbstract`);
class Build extends ThemeScriptAbstract {
constructor(options) {
super(options);
this.validateThemeJson();
if(this.themeJson.development){
this._builder = new Builder(this.paths, this.themeJson.development.buildExcludeFilters);
} else{
this._builder = new Builder(this.paths);
}
}
async execute() {
this.validateThemeJson();
await this.buildTheme();
}
async buildTheme() {
console.info('Building theme');
await this._builder.build();
if (this.themeJson.modules && this.themeJson.modules.length) {
console.info(`Theme has been built manually to: ${this.paths.build}`);
} else {
console.info(`There is no modules to merge with your theme`);
}
}
}
module.exports = Build;