Skip to content

Commit

Permalink
Increment $IN_RIFF (like $SHLVL)
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Aug 30, 2022
1 parent f5f407b commit a800b80
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/nix_dev_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,16 @@ pub async fn run_in_dev_env(
}
}

command.env("IN_RIFF", "1");
// Increment $IN_RIFF.
command.env(
"IN_RIFF",
(std::env::var("IN_RIFF")
.ok()
.and_then(|s| s.parse::<u32>().ok())
.unwrap_or(0)
+ 1)
.to_string(),
);

Ok(command)
}
Expand Down

0 comments on commit a800b80

Please sign in to comment.