Skip to content

Commit

Permalink
Fix: abort root folder search upon reaching filesystem root (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
maltevesper authored Jun 8, 2023
1 parent 6c578fd commit 6e32058
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Correctly abort upwards search for project root directory upon reaching filesystem root.

## [0.1.5] - 2023-03-30
### Added
- Ability to yank/unyank specific versions
Expand Down Expand Up @@ -78,6 +82,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial version

[Unreleased]: https://github.com/f3ath/cider/compare/0.1.5...HEAD
[0.1.5]: https://github.com/f3ath/cider/compare/0.1.4...0.1.5
[0.1.4]: https://github.com/f3ath/cider/compare/0.1.3...0.1.4
[0.1.3]: https://github.com/f3ath/cider/compare/0.1.2...0.1.3
Expand Down
4 changes: 3 additions & 1 deletion lib/src/cider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class Cider {
/// Throws a [StateError] if 'pubspec.yaml' can not be located.
static io.Directory _findRoot(io.Directory dir) {
if (io.File(join(dir.path, 'pubspec.yaml')).existsSync()) return dir;
if (dir == dir.parent) throw StateError('Can not find project root');
if (io.FileSystemEntity.identicalSync(dir.path, dir.parent.path)) {
throw StateError('Can not find project root');
}
return _findRoot(dir.parent);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cider
version: 0.1.5
version: 0.1.6
description: Tools for Dart package maintainers. Automates changelog and pubspec.yaml updates.
homepage: https://github.com/f3ath/cider
repository: https://github.com/f3ath/cider
Expand Down

0 comments on commit 6e32058

Please sign in to comment.