Skip to content

Commit fa1480b

Browse files
committed
workspace: fix error while purging all build directories
1 parent bfdac61 commit fa1480b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
`cargo-install-upgrade` crate. This will speed up the workspace
2525
initialization.
2626

27+
### Fixed
28+
29+
- Calling `Workspace::purge_all_build_dirs` returned an error when no
30+
directories were present instead of doing nothing.
31+
2732
## [0.2.0] - 2019-09-06
2833

2934
### Added

src/workspace.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,10 @@ impl Workspace {
171171

172172
/// Remove all the contents of all the build directories, freeing disk space.
173173
pub fn purge_all_build_dirs(&self) -> Result<(), Error> {
174-
remove_dir_all(self.builds_dir())?;
174+
let dir = self.builds_dir();
175+
if dir.exists() {
176+
remove_dir_all(&dir)?;
177+
}
175178
Ok(())
176179
}
177180

0 commit comments

Comments
 (0)