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

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

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