UNPKG

@albinberisha/codex-cli

Version:

Codex cli to scaffold plugins with Node

42 lines (37 loc) 1.02 kB
import inquirer from 'inquirer'; const environments = [ { name: "Production", url: "https://playground.codex.gjirafa.tech", }, { name: "Staging", url: "https://playground-stg.codex.gjirafa.tech", }, { name: "Development", url: "https://playground.codex.gjirafa.dev", }, { name: "Testing", url: "https://playground-test.codex.gjirafa.tech", }, ]; export async function getEnvironment() { const res = await inquirer.prompt( { type: 'list', name: 'environment', message: 'Please choose what environment to use: ', choices: environments } ); return res.environment; } export async function returnEnvironments() { return environments; } export async function returnEnvironment(name) { const environment = environments.find(e => e.name.toLowerCase() === name.toLowerCase()); return environment; }