@boykaframework/boyka-cli
Version:
🧑🏻💻 Command line assistant for Boyka Framework
24 lines (23 loc) • 678 B
JavaScript
import input from '@inquirer/input';
import { userQuestions } from '../utils/constants.js';
const apiQuestions = userQuestions.api;
export const getBasePath = async () => await input({
message: apiQuestions.basePath,
default: '',
});
export const getBaseUri = async () => await input({
message: apiQuestions.baseUrl,
validate: (message) => {
if (!message) {
return 'Base URL cannot be empty';
}
try {
new URL(message);
return true;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
}
catch (error) {
return 'Invalid URL format';
}
},
});