@dev-thought/nx-deploy-it
Version:
[](https://www.npmjs.com/package/@dev-thought/nx-deploy-it) [](http://opensource.
73 lines • 2.74 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.answerScanQuestions = exports.answerScanQuestionsWithNoApp = exports.answerInitQuestionsGCP = exports.answerInitQuestionsAzure = exports.answerInitQuestionsAWS = exports.delay = exports.KEYS = void 0;
const tslib_1 = require("tslib");
exports.KEYS = {
UP: '\x1B\x5B\x41',
DOWN: '\x1B\x5B\x42',
ENTER: '\x0D',
SPACE: '\x20'
};
exports.delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
function answerInitQuestionsAWS(io, region, awsProfile) {
const initQuestions = () => tslib_1.__awaiter(this, void 0, void 0, function* () {
if (region) {
io.send(region);
}
io.send(exports.KEYS.ENTER);
yield exports.delay(10);
if (awsProfile) {
io.send('my-aws-profile');
}
io.send(exports.KEYS.ENTER);
});
setTimeout(() => initQuestions().then(), 5);
}
exports.answerInitQuestionsAWS = answerInitQuestionsAWS;
function answerInitQuestionsAzure(io, location) {
const initQuestions = () => tslib_1.__awaiter(this, void 0, void 0, function* () {
if (location) {
io.send(location);
}
io.send(exports.KEYS.ENTER);
});
setTimeout(() => initQuestions().then(), 5);
}
exports.answerInitQuestionsAzure = answerInitQuestionsAzure;
function answerInitQuestionsGCP(io, projectId, region) {
const initQuestions = () => tslib_1.__awaiter(this, void 0, void 0, function* () {
io.send(projectId);
io.send(exports.KEYS.ENTER);
yield exports.delay(10);
if (region) {
io.send(region);
io.send(exports.KEYS.ENTER);
}
});
setTimeout(() => initQuestions().then(), 5);
}
exports.answerInitQuestionsGCP = answerInitQuestionsGCP;
function answerScanQuestionsWithNoApp(io) {
const initQuestions = () => tslib_1.__awaiter(this, void 0, void 0, function* () {
io.send(exports.KEYS.ENTER);
});
setTimeout(() => initQuestions().then(), 5);
}
exports.answerScanQuestionsWithNoApp = answerScanQuestionsWithNoApp;
function answerScanQuestions(io, azureLocation) {
const initQuestions = () => tslib_1.__awaiter(this, void 0, void 0, function* () {
io.send(exports.KEYS.SPACE);
io.send(exports.KEYS.ENTER);
yield exports.delay(10);
io.send(exports.KEYS.DOWN);
io.send(exports.KEYS.ENTER);
yield exports.delay(10);
if (azureLocation) {
io.send(azureLocation);
io.send(exports.KEYS.ENTER);
}
});
setTimeout(() => initQuestions().then(), 5);
}
exports.answerScanQuestions = answerScanQuestions;
//# sourceMappingURL=enquirer.utils.js.map