@@ -32,10 +32,14 @@ const OFFICIAL_GENERATORS = new Set([
3232 * @param {import('../router.js').default } app
3333 * @returns
3434 */
35- export const install = app => app . adapter . prompt ( [ {
36- name : 'searchTerm' ,
37- message : 'Search npm for generators:' ,
38- } ] ) . then ( answers => searchNpm ( app , answers . searchTerm ) ) ;
35+ export const install = async app => {
36+ const answers = await app . adapter . prompt ( [ {
37+ name : 'searchTerm' ,
38+ message : 'Search npm for generators:' ,
39+ } ] ) ;
40+
41+ return searchNpm ( app , answers . searchTerm ) ;
42+ } ;
3943
4044const generatorMatchTerm = ( generator , term ) => `${ generator . name } ${ generator . description } ` . includes ( term ) ;
4145const getAllGenerators = _ . memoize ( ( ) => npmKeyword ( 'yeoman-generator' ) ) ;
@@ -79,7 +83,7 @@ async function searchNpm(app, term) {
7983 * @param {import('../router.js').default } app
8084 * @returns
8185 */
82- function promptInstallOptions ( app , choices ) {
86+ async function promptInstallOptions ( app , choices ) {
8387 let introMessage = 'Sorry, no results matches your search term' ;
8488
8589 if ( choices . length > 0 ) {
@@ -99,13 +103,13 @@ function promptInstallOptions(app, choices) {
99103 } ] ,
100104 } ] ;
101105
102- return app . adapter . prompt ( resultsPrompt ) . then ( answer => {
103- if ( answer . toInstall === 'home' || answer . toInstall === 'install' ) {
104- return app . navigate ( answer . toInstall ) ;
105- }
106+ const answer = await app . adapter . prompt ( resultsPrompt ) ;
106107
107- installGenerator ( app , answer . toInstall ) ;
108- } ) ;
108+ if ( answer . toInstall === 'home' || answer . toInstall === 'install' ) {
109+ return app . navigate ( answer . toInstall ) ;
110+ }
111+
112+ installGenerator ( app , answer . toInstall ) ;
109113}
110114
111115function installGenerator ( app , packageName ) {
0 commit comments