Skip to content

Commit

Permalink
write to /tmp/ on non-windows I suppose
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Oct 13, 2024
1 parent 38729e4 commit 9f6f612
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ impl CertAuth {
let keypair = rcgen::KeyPair::generate().unwrap();
let cert = params.self_signed(&keypair).unwrap();

let temp_dir = std::env::temp_dir();
let temp_dir = if cfg!(windows) {
std::env::temp_dir()
} else {
std::path::PathBuf::from("/tmp")
};

if !temp_dir.exists() {
tracing::info!("Creating temp dir {temp_dir:?}");
std::fs::create_dir_all(&temp_dir).unwrap();
Expand Down

0 comments on commit 9f6f612

Please sign in to comment.