diff --git a/ember-basic-dropdown/blueprints/ember-basic-dropdown/index.js b/ember-basic-dropdown/blueprints/ember-basic-dropdown/index.js index 16bb5cc8..d8e9217d 100644 --- a/ember-basic-dropdown/blueprints/ember-basic-dropdown/index.js +++ b/ember-basic-dropdown/blueprints/ember-basic-dropdown/index.js @@ -14,6 +14,7 @@ module.exports = { afterInstall() { let dependencies = this.project.dependencies(); + const promises = []; let skipStyleImport = false; if ('ember-power-select' in dependencies) { @@ -38,7 +39,7 @@ module.exports = { } if (fs.existsSync(file)) { this.ui.writeLine(`Added import statement to ${file}`); - this.insertIntoFile(file, importStatement, {}); + promises.push(this.insertIntoFile(file, importStatement, {})); } else { fs.writeFileSync(file, importStatement); this.ui.writeLine(`Created ${file}`); @@ -50,9 +51,11 @@ module.exports = { } if (fs.existsSync(file)) { this.ui.writeLine(`Added import statement to ${file}`); - this.insertIntoFile(file, "import 'ember-basic-dropdown/styles';", { - after: "config/environment';" + EOL, - }); + promises.push( + this.insertIntoFile(file, "import 'ember-basic-dropdown/styles';", { + after: "config/environment';" + EOL, + }), + ); } } } @@ -61,11 +64,15 @@ module.exports = { let applicationFile = path.join(templatePath, `application.hbs`); if (fs.existsSync(applicationFile)) { this.ui.writeLine(`Added wormhole statement to ${applicationFile}`); - this.insertIntoFile( - applicationFile, - `${EOL}`, - {}, + promises.push( + this.insertIntoFile( + applicationFile, + `${EOL}`, + {}, + ), ); } + + return Promise.all(promises); }, };