Skip to content

Commit

Permalink
Gracefully complete when environment not found in old config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Carter committed Sep 28, 2020
1 parent bc35090 commit 4b6cc9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion ci/release_notes.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Empty - please add release notes here
## Bug Fixes

- Fix `Error: Couldn't find environment` after adding new environment to `cepler.yml`
9 changes: 5 additions & 4 deletions src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ impl Workspace {
} else {
return Ok(None);
};
let env = config
.environments
.get(env_name)
.context("Couldn't find environment")?;
let env = if let Some(env) = config.environments.get(env_name) {
env
} else {
return Ok(None);
};
let database = Database::open_env(
&self.path_to_config,
&env.name,
Expand Down

0 comments on commit 4b6cc9f

Please sign in to comment.