UNPKG

@reliverse/rse

Version:

@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power

36 lines (35 loc) 1.19 kB
import { getOrCreateRseConfig } from "@reliverse/cfg"; import { relinka } from "@reliverse/relinka"; import { confirmPrompt } from "@reliverse/rempts"; import { FALLBACK_ENV_EXAMPLE_URL } from "../constants.js"; import { composeEnvFile } from "../init/use-template/cp-modules/compose-env-file/cef-mod.js"; import { getCurrentWorkingDirectory } from "../utils/terminalHelpers.js"; export async function envArgImpl(isDev, pathToProject) { try { const projectPath = pathToProject ?? getCurrentWorkingDirectory(); const { config } = await getOrCreateRseConfig({ projectPath, isDev, overrides: {} }); const maskInput = await confirmPrompt({ title: "Do you want to mask secret inputs (e.g., GitHub token) in the next steps?", content: "Regardless of your choice, your data will be securely stored on your device." }); await composeEnvFile( projectPath, FALLBACK_ENV_EXAMPLE_URL, maskInput, false, config, false ); } catch (error) { relinka( "error", "Failed to compose .env file:", error instanceof Error ? error.message : JSON.stringify(error) ); process.exit(1); } }