Skip to content

Commit

Permalink
fix: windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmasoldi3r committed Dec 1, 2023
1 parent 17d7d82 commit afe7487
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions janus/src/compilation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,13 @@ impl CompilationHost {
} else {
out_path.with_extension("exe")
};
let mut open_options = OpenOptions::new();
let out = open_options.write(true).create(true).truncate(true);
#[cfg(target_family = "unix")]
use std::os::unix::fs::OpenOptionsExt;
let mut out = OpenOptions::new()
.write(true)
.create(true)
.truncate(true)
.mode(0o711)
.open(out_path)
.unwrap();
#[cfg(target_family = "unix")]
let mut out = out.mode(0o711);
let mut out = out.open(out_path).unwrap();
out.write_all(binaries).unwrap();
let main_src = fs::read(&path).unwrap();
out.write_all(&main_src).unwrap();
Expand Down

0 comments on commit afe7487

Please sign in to comment.