import * as inquirer from "inquirer" ; import { getOfficeAppName , OfficeApp } from "office-addin-manifest" ; export async function chooseOfficeApp ( apps ) { const questionName = "app" ; const question = { choices : apps . map ( ( app ) => { return { name : getOfficeAppName ( app ) , value : app } ; } ) . sort ( ( first , second ) => first . name . localeCompare ( second . name ) ) , message : "Which Office app?" , name : questionName , type : "list" , } ; const answer = await inquirer . prompt ( [ question ] ) ; const choice = answer [ questionName ] ; return choice ; }