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 {
29
29
_log.fine ('Starting .env search from: ${currentDir .path }' );
30
30
// Traverse up the directory tree to find pubspec.yaml
31
31
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 ' );
34
35
if (File (pubspecPath).existsSync ()) {
35
36
// 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
+ );
38
41
if (File (envPath).existsSync ()) {
39
- _log.info ('Found .env file at: ' );
42
+ _log.info ('Found .env file at: $ envPath ' );
40
43
env.load ([envPath]); // Load variables from the found .env file
41
44
return env; // Return immediately upon finding
42
45
} else {
You can’t perform that action at this time.
0 commit comments