Skip to content

Commit

Permalink
fix: Relative is required when bin is used
Browse files Browse the repository at this point in the history
  • Loading branch information
juanibiapina committed May 22, 2024
1 parent 5bbd8a9 commit ad53e0f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,13 @@ fn parse_sub_cli_args() -> SubCliArgs {
.canonicalize()
.expect("Invalid `bin` path")
.clone();

path.pop(); // remove bin name
if let Some(relative) = args.get_one::<PathBuf>("relative") {
path.push(relative)
};
path.canonicalize()
.expect("Invalid `bin` or `relative` arguments")

let relative = args.get_one::<PathBuf>("relative").expect("Missing `relative` argument");
path.push(relative);

path.canonicalize().expect("Invalid `bin` or `relative` arguments")
}
},
}
Expand Down

0 comments on commit ad53e0f

Please sign in to comment.