Commit 8c7c0653 authored by Philipp Nowinski's avatar Philipp Nowinski

[BUGFIX] do not display ads multiple times when running composed tasks

parent af934a04
......@@ -15,10 +15,10 @@ module.exports = class task {
/**
* Kick things off
*/
constructor() {
constructor(_options = {embedded: false}) {
this._settings = settings;
this._config = settings.config;
this._embedded = false;
this._embedded = _options.embedded;
this._path = this._settings.getPath();
this._logger = require('./logger');
this.extensionName = settings.Extension;
......@@ -33,7 +33,7 @@ module.exports = class task {
this._config.mode = 'dev';
this._logger.info(`Starting task ${chalk.bold(this.constructor.name.toLowerCase())} in dev mode`);
}
if (!this._settings.validLicense) {
if (!this._settings.validLicense && !this._embedded) {
this._runAd();
}
}
......@@ -99,16 +99,6 @@ module.exports = class task {
return writeFile(_filePath, _content);
}
/**
* Sets the _embedded property, which indicates that this task is not being
* run on its own, but is part of an orchestrated task
*
* @param {boolean} _value
*/
set embedded(_value) {
this._embedded = _value;
}
/**
* Displays an ad as a push notification
*
......
......@@ -20,14 +20,11 @@ module.exports = class Build extends Task {
await Promise.all(this._config.extensions.map(async _extension => {
settings.setExtension(_extension);
let tasks = [];
let task = new images();
task.embedded = true;
let task = new images({embedded: true});
tasks.push(task.run());
task = new css();
task.embedded = true;
task = new css({embedded: true});
tasks.push(task.run());
task = new js();
task.embedded = true;
task = new js({embedded: true});
tasks.push(task.run());
await Promise.all(tasks);
}));
......
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