33
44const chalk = require ( 'chalk' ) ;
55const fs = require ( 'fs' ) ;
6- const glob = require ( 'glob' ) ;
6+ const globSync = require ( 'glob' ) . globSync ;
77const mkdirp = require ( 'mkdirp' ) ;
88const p = require ( 'util' ) . promisify ;
99const path = require ( 'path' ) ;
@@ -65,7 +65,7 @@ module.exports = {
6565
6666 // Handle "Classic" layout
6767 let templatesRoot = path . join ( root , 'app/templates/components' ) ;
68- let templateCandidates = await p ( glob ) ( '**/*.hbs' , { cwd : templatesRoot } ) ;
68+ let templateCandidates = globSync ( '**/*.hbs' , { cwd : templatesRoot } ) ;
6969
7070 templateCandidates . forEach ( ( template ) => {
7171 let templatePath = path . join ( 'app/templates/components' , template ) ;
@@ -89,7 +89,7 @@ module.exports = {
8989 // Handle "Pods" layout without prefix
9090
9191 let componentsRoot = path . join ( root , 'app/components' ) ;
92- templateCandidates = await p ( glob ) ( '**/template.hbs' , {
92+ templateCandidates = globSync ( '**/template.hbs' , {
9393 cwd : componentsRoot ,
9494 } ) ;
9595
@@ -115,7 +115,7 @@ module.exports = {
115115 // Handle "Pods" layout *with* prefix
116116
117117 componentsRoot = path . join ( root , `app/${ podsFolder } /components` ) ;
118- templateCandidates = await p ( glob ) ( '**/template.hbs' , {
118+ templateCandidates = globSync ( '**/template.hbs' , {
119119 cwd : componentsRoot ,
120120 } ) ;
121121
@@ -179,8 +179,8 @@ module.exports = {
179179 ) }
180180 ` ) ;
181181 }
182-
183- let response = await require ( 'inquirer' ) . prompt ( {
182+ const prompt = require ( 'inquirer' ) . createPromptModule ( ) ;
183+ let response = await prompt ( {
184184 type : 'confirm' ,
185185 name : 'shouldGenerate' ,
186186 message : 'Would you like me to generate these component files for you?' ,
0 commit comments