MCPcopy
hub / github.com/qawolf/cli / loadEnvFile

Function loadEnvFile

src/commands/flows/loadEnvFile.ts:7–19  ·  view source on GitHub ↗
(envDir: string)

Source from the content-addressed store, hash-verified

5import { parseDotenv } from "~/core/dotenv.js";
6
7export async function loadEnvFile(envDir: string): Promise<void> {
8 let content: string;
9 try {
10 content = await readFile(join(envDir, ".env"), "utf8");
11 } catch (err) {
12 if (isNoEntError(err)) return;
13 throw err;
14 }
15 const vars = parseDotenv(content);
16 for (const [key, value] of Object.entries(vars)) {
17 if (process.env[key] === undefined) process.env[key] = value;
18 }
19}

Callers 2

runStagedFlowsFunction · 0.85

Calls 3

isNoEntErrorFunction · 0.85
parseDotenvFunction · 0.85
readFileFunction · 0.50

Tested by

no test coverage detected