Skip to content

Commit

Permalink
Allow relative paths with --manifest-path
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyr committed Nov 17, 2022
1 parent 4d33fae commit c7b94d8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ pub(crate) fn run(app_config: AppConfig) -> Result<()> {

// 3. Build the specified target
let cargo_config = Config::default()?;
let manifest_path = app_config
.manifest_path
.clone()
.map_or_else(|| important_paths::find_root_manifest_for_wd(cargo_config.cwd()), Ok)?;

let manifest_path = match app_config.manifest_path.as_ref() {
Some(path) if path.is_absolute() => Ok(path.to_owned()),
Some(path) => Ok(cargo_config.cwd().join(path)),
None => important_paths::find_root_manifest_for_wd(cargo_config.cwd()),
}?;

let workspace = Workspace::new(&manifest_path, &cargo_config)?;

// 3.1: warn if --open passed. We do this here so we have access to cargo's
Expand Down

0 comments on commit c7b94d8

Please sign in to comment.