From 88d37f3b755e0ae37e8469d0e698269dcecaf2b9 Mon Sep 17 00:00:00 2001 From: nicohman Date: Tue, 23 Jul 2019 12:00:37 -0700 Subject: [PATCH] Try fix for windows compilation --- src/extract.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/extract.rs b/src/extract.rs index b8a894d..4158410 100644 --- a/src/extract.rs +++ b/src/extract.rs @@ -9,6 +9,7 @@ use std::io::Read; use std::io::SeekFrom::*; use std::io::Write; use std::iter::FromIterator; +#[cfg(unix)] use std::os::unix::fs::PermissionsExt; use std::path::*; pub struct ToExtract { @@ -253,9 +254,12 @@ where let unpacker_name = out_dir.clone().join("unpacker.sh").as_path().to_owned(); if extract.unpacker { let mut unpacker_fd = File::create(unpacker_name)?; - let mut perms = unpacker_fd.metadata()?.permissions(); - perms.set_mode(0o744); - unpacker_fd.set_permissions(perms)?; + #[cfg(unix)] + { + let mut perms = unpacker_fd.metadata()?.permissions(); + perms.set_mode(0o744); + unpacker_fd.set_permissions(perms)?; + } unpacker_fd.write_all(&script_bin)?; } let script = String::from_utf8(script_bin).unwrap(); -- 2.45.2