UNPKG

681 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const color_1 = require("./color");
4function createOnFallback({ flags: { confirm }, log }) {
5 return (question) => {
6 if (question.type === 'confirm') {
7 if (confirm) {
8 log.msg(`${color_1.input('--confirm')}: ${color_1.weak(question.message)} ${color_1.ancillary('Yes')}`);
9 return true;
10 }
11 else {
12 log.msg(`${color_1.input('--no-confirm')}: ${color_1.weak(question.message)} ${color_1.ancillary('No')}`);
13 return false;
14 }
15 }
16 };
17}
18exports.createOnFallback = createOnFallback;