diff --git a/src/cli/build.rs b/src/cli/build.rs index b158c69..ed5a050 100644 --- a/src/cli/build.rs +++ b/src/cli/build.rs @@ -44,18 +44,18 @@ pub async fn build_standalone + Into>( patched_bin.append(&mut signature.clone()); // Write the compiled binary to file - if cfg!(unix) { - OpenOptions::new() - .write(true) - .create(true) - .mode(0o770) - .open(output_path) - .await? - .write_all(&patched_bin) - .await?; - } else if cfg!(windows) { - fs::write(output_path, &patched_bin).await?; - } + #[cfg(not(target_os = "windows"))] + OpenOptions::new() + .write(true) + .create(true) + .mode(0o770) + .open(&output_path) + .await? + .write_all(&patched_bin) + .await?; + + #[cfg(target_os = "windows")] + fs::write(&output_path, &patched_bin).await?; Ok(ExitCode::SUCCESS) }