Skip to content

Commit

Permalink
Passing a relative path to Workspace now bails with proper message.
Browse files Browse the repository at this point in the history
Previously, this failure will return an unhelpful warning.
This commit adds an error message saying that the argument for
`manifest_path` must be an absolute path.
  • Loading branch information
hbina committed Jun 4, 2020
1 parent 9907039 commit 84f1dc1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cargo/core/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ impl<'cfg> Workspace<'cfg> {
ws.target_dir = config.target_dir()?;

if manifest_path.is_relative() {
ws.root_manifest = Some(std::env::current_dir()?);
anyhow::bail!(
"manifest_path:{:?} is not an absolute path. Please provide an absolute path.",
manifest_path
)
} else {
ws.root_manifest = ws.find_root(manifest_path)?;
}
Expand Down

0 comments on commit 84f1dc1

Please sign in to comment.