vasku
Version:
TVM-Solidity contract development framework
56 lines (55 loc) • 2.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.showMainMenu = void 0;
const enquirer_1 = require("./enquirer");
const commands_1 = require("../commands");
const compile_1 = require("../actions/compile");
const showTestMenu_1 = require("./showTestMenu");
const showRunMenu_1 = require("./showRunMenu");
const showGiverMenu_1 = require("./showGiverMenu");
const showSEMenu_1 = require("./showSEMenu");
const clean_1 = require("../actions/clean");
const help_1 = require("../actions/help");
async function showMainMenu(config) {
const choice = await (new enquirer_1.Select({
message: 'Vasku',
choices: [
commands_1.COMPILE,
commands_1.TEST + enquirer_1.ELLIPSIS,
commands_1.RUN + enquirer_1.ELLIPSIS,
commands_1.GIVER + enquirer_1.ELLIPSIS,
commands_1.SE + enquirer_1.ELLIPSIS,
commands_1.CLEAN,
enquirer_1.HELP,
enquirer_1.QUIT
]
})).run();
switch (choice) {
case commands_1.COMPILE:
await (0, compile_1.compile)(config);
break;
case commands_1.TEST + enquirer_1.ELLIPSIS:
process.argv.push(commands_1.TEST);
await (0, showTestMenu_1.showTestMenu)(config);
break;
case commands_1.RUN + enquirer_1.ELLIPSIS:
process.argv.push(commands_1.RUN);
await (0, showRunMenu_1.showRunMenu)(config);
break;
case commands_1.GIVER + enquirer_1.ELLIPSIS:
process.argv.push(commands_1.GIVER);
await (0, showGiverMenu_1.showGiverMenu)(config);
break;
case commands_1.SE + enquirer_1.ELLIPSIS:
process.argv.push(commands_1.SE);
await (0, showSEMenu_1.showSEMenu)(config);
break;
case commands_1.CLEAN:
(0, clean_1.clean)(config.paths);
break;
case enquirer_1.HELP:
(0, help_1.help)();
break;
}
}
exports.showMainMenu = showMainMenu;