27 lines
1.0 KiB
JavaScript
27 lines
1.0 KiB
JavaScript
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
// Licensed under the MIT license.
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.chooseOfficeApp = void 0;
|
||
|
const tslib_1 = require("tslib");
|
||
|
const inquirer = require("inquirer");
|
||
|
const office_addin_manifest_1 = require("office-addin-manifest");
|
||
|
function chooseOfficeApp(apps) {
|
||
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
||
|
const questionName = "app";
|
||
|
const question = {
|
||
|
choices: apps
|
||
|
.map((app) => {
|
||
|
return { name: (0, office_addin_manifest_1.getOfficeAppName)(app), value: app };
|
||
|
})
|
||
|
.sort((first, second) => first.name.localeCompare(second.name)),
|
||
|
message: "Which Office app?",
|
||
|
name: questionName,
|
||
|
type: "list",
|
||
|
};
|
||
|
const answer = yield inquirer.prompt([question]);
|
||
|
const choice = answer[questionName];
|
||
|
return choice;
|
||
|
});
|
||
|
}
|
||
|
exports.chooseOfficeApp = chooseOfficeApp;
|
||
|
//# sourceMappingURL=prompt.js.map
|