Skip to content

Commit b5bb9cc

Browse files
authored
Add blueprint support (#1015)
1 parent b10ca0a commit b5bb9cc

File tree

1 file changed

+24
-1
lines changed
  • ember-basic-dropdown/blueprints/ember-basic-dropdown

1 file changed

+24
-1
lines changed

ember-basic-dropdown/blueprints/ember-basic-dropdown/index.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
// to us
1313
},
1414

15-
afterInstall() {
15+
async afterInstall() {
1616
let dependencies = this.project.dependencies();
1717
const promises = [];
1818
let skipStyleImport = false;
@@ -71,6 +71,29 @@ module.exports = {
7171
{},
7272
),
7373
);
74+
} else {
75+
applicationFile = path.join(templatePath, `application.gts`);
76+
if (!fs.existsSync(applicationFile)) {
77+
file = path.join(templatePath, `application.gjs`);
78+
}
79+
if (fs.existsSync(applicationFile)) {
80+
this.ui.writeLine(`Added wormhole statement to ${applicationFile}`);
81+
await this.insertIntoFile(
82+
applicationFile,
83+
`import BasicDropdownWormhole from 'ember-basic-dropdown/components/basic-dropdown-wormhole';${EOL}`,
84+
{
85+
before: '<template>',
86+
},
87+
);
88+
89+
await this.insertIntoFile(
90+
applicationFile,
91+
`${EOL} <BasicDropdownWormhole />`,
92+
{
93+
after: '<template>',
94+
},
95+
);
96+
}
7497
}
7598

7699
return Promise.all(promises);

0 commit comments

Comments
 (0)