solana-install now compiles for Windows (#4531)

automerge
This commit is contained in:
Michael Vines
2019-06-04 08:51:20 -07:00
committed by Grimes
parent 70a16e91a5
commit 3635a68129
3 changed files with 30 additions and 13 deletions

View File

@ -513,6 +513,15 @@ pub fn deploy(
Ok(())
}
#[cfg(windows)]
fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> std::io::Result<()> {
std::os::windows::fs::symlink_dir(src, dst)
}
#[cfg(not(windows))]
fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> std::io::Result<()> {
std::os::unix::fs::symlink(src, dst)
}
pub fn update(config_file: &str) -> Result<bool, String> {
let update_manifest = info(config_file, false)?;
if update_manifest.is_none() {
@ -565,7 +574,7 @@ pub fn update(config_file: &str) -> Result<bool, String> {
}
let _ = fs::remove_dir_all(config.active_release_dir());
std::os::unix::fs::symlink(
symlink_dir(
release_dir.join("solana-release"),
config.active_release_dir(),
)