Skip to content

Commit 96912c2

Browse files
committed
feat(config): enhance .env loading logs
1 parent 20a92d2 commit 96912c2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/src/config/environment_config.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ abstract final class EnvironmentConfig {
2929
_log.fine('Starting .env search from: ${currentDir.path}');
3030
// Traverse up the directory tree to find pubspec.yaml
3131
while (currentDir.parent.path != currentDir.path) {
32-
final pubspecPath = '${currentDir.path}/pubspec.yaml';
33-
_log.finer('Checking for pubspec.yaml at: ');
32+
final pubspecPath =
33+
'${currentDir.path}${Platform.pathSeparator}pubspec.yaml';
34+
_log.finer('Checking for pubspec.yaml at: $pubspecPath');
3435
if (File(pubspecPath).existsSync()) {
3536
// Found pubspec.yaml, now load .env from the same directory
36-
final envPath = '${currentDir.path}/.env';
37-
_log.info('Found pubspec.yaml, now looking for .env at: ');
37+
final envPath = '${currentDir.path}${Platform.pathSeparator}.env';
38+
_log.info(
39+
'Found pubspec.yaml, now looking for .env at: ${currentDir.path}',
40+
);
3841
if (File(envPath).existsSync()) {
39-
_log.info('Found .env file at: ');
42+
_log.info('Found .env file at: $envPath');
4043
env.load([envPath]); // Load variables from the found .env file
4144
return env; // Return immediately upon finding
4245
} else {

0 commit comments

Comments
 (0)