chore: improve CWD warning message

This commit is contained in:
Isaac 2024-01-13 01:45:09 +00:00
parent a349b0e0ff
commit f126a6d4a3
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -41,9 +41,11 @@ const base_dir = path.resolve(path.join(__dirname, '../'));
const cwd = path.resolve(process.cwd()); const cwd = path.resolve(process.cwd());
if (base_dir !== cwd) { if (base_dir !== cwd) {
console.log('\x07' + colours.yellowBright('Warning: The current working directory is not the same as the base directory.')); console.log('\x07' + colours.yellowBright('Warning: The current working directory is not the same as the base directory.'));
console.log(colours.yellowBright('This may result in unexpected behaviour, particularly with missing environment variables.')); if (!process.env.DOCKER) {
console.log(' Base directory: ' + colours.gray(base_dir)); console.log(colours.yellowBright('This may result in unexpected behaviour, particularly with missing environment variables.'));
console.log(' CWD: ' + colours.gray(cwd)); }
console.log(' Base directory: ' + colours.gray(base_dir));
console.log(' Current directory: ' + colours.gray(cwd));
console.log(colours.blueBright(' Learn more at https://lnk.earth/dt-cwd.')); console.log(colours.blueBright(' Learn more at https://lnk.earth/dt-cwd.'));
} }