Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tools/local-env/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ const dotenv = require( 'dotenv' );
const dotenvExpand = require( 'dotenv-expand' );
const { execSync, spawnSync } = require( 'child_process' );
const local_env_utils = require( './utils' );
const { constants, copyFile } = require( 'node:fs' );
const { constants, copyFileSync } = require( 'node:fs' );

// Copy the default .env file when one is not present.
copyFile( '.env.example', '.env', constants.COPYFILE_EXCL, () => {
try {
copyFileSync( '.env.example', '.env', constants.COPYFILE_EXCL );
} catch ( e ) {
console.log( '.env file already exists. .env.example was not copied.' );
});
}
Comment on lines +10 to +14

@sirreal sirreal Jul 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good feedback. A better approach is probably to check whether the file already exists at the destination and copy if it doesn't, the try/catch should be safe to remove then, any errors that surface are useful information.


dotenvExpand.expand( dotenv.config() );

Expand Down
Loading