mirror of
https://github.com/logto-io/logto.git
synced 2025-01-27 21:39:16 -05:00
fix: support capital letter "Y" in command line prompt
This commit is contained in:
parent
443f45ed2e
commit
416f4e86e3
2 changed files with 3 additions and 2 deletions
|
@ -19,7 +19,7 @@ const question = async (query) => new Promise((resolve) => {
|
||||||
|
|
||||||
const confirm = async (query) => {
|
const confirm = async (query) => {
|
||||||
const answer = await question(`${query} (Y/n) `);
|
const answer = await question(`${query} (Y/n) `);
|
||||||
return answer === '' || ['y', 'yes', 'yep', 'yeah'].includes(answer);
|
return answer === '' || ['y', 'yes', 'yep', 'yeah'].includes(answer.toLowerCase());
|
||||||
};
|
};
|
||||||
|
|
||||||
const safeExecSync = (command) => {
|
const safeExecSync = (command) => {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { getEnv } from '@silverhand/essentials';
|
import { getEnv } from '@silverhand/essentials';
|
||||||
|
|
||||||
export const isTrue = (value: string) => ['1', 'true', 'y', 'yes', 'yep', 'yeah'].includes(value);
|
export const isTrue = (value: string) =>
|
||||||
|
['1', 'true', 'y', 'yes', 'yep', 'yeah'].includes(value.toLowerCase());
|
||||||
|
|
||||||
const parameters = new Set(process.argv.slice(2));
|
const parameters = new Set(process.argv.slice(2));
|
||||||
export const noInquiry = parameters.has('--no-inquiry') || isTrue(getEnv('NO_INQUIRY'));
|
export const noInquiry = parameters.has('--no-inquiry') || isTrue(getEnv('NO_INQUIRY'));
|
||||||
|
|
Loading…
Add table
Reference in a new issue