MCPcopy Index your code
hub / github.com/AutoForgeAI/autoforge / ensureEnvFile

Function ensureEnvFile

lib/cli.js:367–379  ·  view source on GitHub ↗

* Ensure ~/.autoforge/.env exists. On first run, copy .env.example * from the package directory and print a notice. * * Returns true if the file was newly created.

()

Source from the content-addressed store, hash-verified

365 * Returns true if the file was newly created.
366 */
367function ensureEnvFile() {
368 if (existsSync(ENV_FILE)) return false;
369
370 mkdirSync(CONFIG_HOME, { recursive: true });
371
372 if (existsSync(ENV_EXAMPLE)) {
373 copyFileSync(ENV_EXAMPLE, ENV_FILE);
374 } else {
375 // Fallback: create a minimal placeholder
376 writeFileSync(ENV_FILE, '# AutoForge configuration\n# See documentation for available options.\n', 'utf8');
377 }
378 return true;
379}
380
381// ---------------------------------------------------------------------------
382// Port detection

Callers 2

handleConfigFunction · 0.85
startServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected