MCPcopy Create free account
hub / github.com/PalisadoesFoundation/talawa-api / initializeEnvFile

Function initializeEnvFile

scripts/setup/setup.ts:498–521  ·  view source on GitHub ↗
(answers: SetupAnswers)

Source from the content-addressed store, hash-verified

496 return checkEnvFileInternal(envFileName);
497}
498export async function initializeEnvFile(answers: SetupAnswers): Promise<void> {
499 const envFileToUse =
500 answers.CI === "true" ? "envFiles/.env.ci" : "envFiles/.env.devcontainer";
501 try {
502 await initializeEnvFileInternal({
503 ci: answers.CI === "true",
504 envFile: envFileName,
505 backupFile: envBackupFile,
506 tempFile: envTempFile,
507 templateCiFile: "envFiles/.env.ci",
508 templateDevcontainerFile: "envFiles/.env.devcontainer",
509 restoreFromBackup: backupCreated,
510 });
511 console.log(
512 `✅ Environment variables loaded successfully from ${envFileToUse}`,
513 );
514 } catch (error) {
515 console.error(
516 `❌ Error: Failed to load environment file '${envFileToUse}'.`,
517 );
518 console.error(error instanceof Error ? error.message : error);
519 throw error;
520 }
521}
522export async function setCI(answers: SetupAnswers): Promise<SetupAnswers> {
523 try {
524 answers.CI = await promptList("CI", "Set CI:", ["true", "false"], "false");

Callers 2

envSetup.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected