diff --git a/CHANGELOG.md b/CHANGELOG.md index c786946..1e603df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ To install RC v0.3.1 with command: ```bash -dart pub add orm:0.3.1 +dart pub add orm:^0.3.1 ``` Or update your `pubspec.yaml` file: diff --git a/lib/src/loaders/dotenv/_find_project_directory.dart b/lib/src/loaders/dotenv/_find_project_directory.dart index 1655c15..2d46c05 100644 --- a/lib/src/loaders/dotenv/_find_project_directory.dart +++ b/lib/src/loaders/dotenv/_find_project_directory.dart @@ -11,6 +11,7 @@ Directory? _nestFindPubspecDirectory(Directory directory, bool shouldWarn) { try { final pubspec = File(path.join(directory.path, 'pubspec.yaml')); if (pubspec.existsSync()) return directory; + if (_isOsRoot(directory)) return null; return _nestFindPubspecDirectory(directory.parent, shouldWarn); } catch (e) { @@ -21,3 +22,11 @@ Directory? _nestFindPubspecDirectory(Directory directory, bool shouldWarn) { return null; } } + +bool _isOsRoot(Directory directory) { + if (Platform.isWindows) { + return directory.path.endsWith(':\\'); + } + + return path.relative(directory.path, from: '/') == '.'; +}