File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments