Skip to content

Commit

Permalink
Merge pull request #105 from pwnwriter/feat/js
Browse files Browse the repository at this point in the history
chore(exec): check if the ss was successful or not and then only log
  • Loading branch information
pwnwriter committed Jun 20, 2024
2 parents 184a95b + 4f67059 commit b3c1d2c
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/cli/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pub async fn run(
}
}

if stdin {
let is_screenshot_taken = if stdin {
env::set_current_dir(dump_dir)?;
let urls = super::hxn_helper::read_urls_from_stdin(ports)?;
take_screenshot_in_bulk(
Expand All @@ -108,7 +108,7 @@ pub async fn run(
accept_invalid_certs,
javascript,
)
.await?;
.await
} else {
match (url, file_path) {
(None, Some(file_path)) => {
Expand All @@ -126,7 +126,7 @@ pub async fn run(
accept_invalid_certs,
javascript,
)
.await?;
.await
}
(Some(url), None) => {
let urls = if let Some(ports) = ports {
Expand All @@ -147,16 +147,20 @@ pub async fn run(
accept_invalid_certs,
javascript,
)
.await?;
.await
}
_ => unreachable!(),
}
}

info(
format!("Screenshots Taken and saved in directory {}", outdir.bold()),
colored::Color::Cyan,
);
};

Ok(())
match is_screenshot_taken {
Ok(_) => {
info(
format!("Screenshots Taken and saved in directory {}", outdir.bold()),
colored::Color::Cyan,
);
Ok(())
}
Err(e) => Err(e),
}
}

0 comments on commit b3c1d2c

Please sign in to comment.