Skip to content

Commit 7f6ba3c

Browse files
committed
chore(bench): fix handling ommit --bench arg
1 parent 1ab46c9 commit 7f6ba3c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

headless_browser_lib/src/conf.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,12 @@ lazy_static::lazy_static! {
315315
};
316316
/// The chrome launch path.
317317
pub static ref CHROME_PATH: String = {
318+
// cargo bench will always pass in the first arg
318319
let default_path = std::env::args().nth(1).unwrap_or_default();
320+
let trimmed_path = default_path.trim();
319321

320322
// handle testing and default to OS
321-
if default_path.is_empty() || default_path.trim() == "--nocapture" {
323+
if default_path.is_empty() || trimmed_path == "--nocapture" || trimmed_path == "--bench" {
322324
let chrome_path = match std::env::var("CHROME_PATH") {
323325
Ok(p) => p,
324326
_ => Default::default()

0 commit comments

Comments
 (0)