Skip to content

Commit

Permalink
fix: macos remove binaries before replacing (#3735)
Browse files Browse the repository at this point in the history
  • Loading branch information
digikata authored Nov 22, 2023
1 parent 5d03c8d commit 1e70198
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions crates/fluvio-version-manager/src/common/version_directory.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use std::fs::{read_dir, copy, create_dir_all};

#[cfg(target_os = "macos")]
use std::fs::remove_file;

use std::path::PathBuf;

use anyhow::Result;
Expand Down Expand Up @@ -74,6 +78,18 @@ impl VersionDirectory {
))?;
let target_path = fluvio_bin_dir.join(filename);

//remove for macos to sync w/ downloaded bin restrictions
#[cfg(target_os = "macos")]
if let Err(err) = remove_file(&target_path) {
use tracing::debug;
match err.kind() {
std::io::ErrorKind::NotFound => {}
_ => {
debug!("ioerr: {}", err);
}
}
}

copy(entry, &target_path)?;
tracing::info!(?target_path, "Copied binary");
}
Expand Down

0 comments on commit 1e70198

Please sign in to comment.