Skip to content

Commit

Permalink
fix: ensure that NRR_COMPAT_MODE is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanccn committed Nov 17, 2023
1 parent 2d6ec80 commit 7483b4d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ async fn execute(
async fn main() -> Result<()> {
let raw_args: Vec<String> = env::args().collect();

let cli =
if env::var_os("NRR_COMPAT_MODE").is_some() && raw_args.get(1) == Some(&"run".to_owned()) {
let mut processed_args = raw_args.clone();
processed_args.remove(1);
let cli = if env::var_os("NRR_COMPAT_MODE").is_some_and(|v| !v.is_empty())
&& raw_args.get(1) == Some(&"run".to_owned())
{
let mut processed_args = raw_args.clone();
processed_args.remove(1);

Cli::parse_from(&processed_args)
} else {
Expand Down

0 comments on commit 7483b4d

Please sign in to comment.