File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
blueprints/ember-cli-capacitor Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -5,19 +5,23 @@ const { execSync } = require('child_process');
55module . exports = {
66 description : 'Sets up Capacitor for your Ember app.' ,
77
8- afterInstall ( ) {
9- this . addPackagesToProject ( [
8+ normalizeEntityName ( ) { } ,
9+
10+ async afterInstall ( ) {
11+ await this . addPackagesToProject ( [
1012 { name : '@capacitor/core' } ,
1113 { name : '@capacitor/cli' }
1214 ] ) ;
15+
16+ await this . _addPlatforms ( ) ;
1317 } ,
1418
1519 /**
1620 * Uses inquirer to prompt the user to select which platforms to support
1721 * @returns {Promise } Resolves into array of selected platforms
1822 * @private
1923 */
20- _addPlatforms ( ) {
24+ async _addPlatforms ( ) {
2125 let choices = [
2226 {
2327 checked : true ,
@@ -36,17 +40,16 @@ module.exports = {
3640 }
3741 ] ;
3842
39- // Ask which npm packages to install
40- return this . ui . prompt ( {
43+ // Ask which platforms to support
44+ const selected = await this . ui . prompt ( {
4145 type : 'checkbox' ,
4246 name : 'platforms' ,
4347 message : 'Which platforms would you like to support?' ,
4448 choices
45- } )
46- . then ( ( selected ) => {
47- selected . platforms . forEach ( ( platform ) => {
48- execSync ( `npx cap add ${ platform } ` ) ;
49- } ) ;
50- } ) ;
49+ } ) ;
50+
51+ selected . platforms . forEach ( ( platform ) => {
52+ execSync ( `npx cap add ${ platform } ` ) ;
53+ } ) ;
5154 }
5255} ;
You can’t perform that action at this time.
0 commit comments