diff --git a/src/refractr.rs b/src/refractr.rs index 6b70924..6863f0f 100644 --- a/src/refractr.rs +++ b/src/refractr.rs @@ -9,7 +9,7 @@ use hex; use sha2::{Sha256, Digest}; use std::env; use std::fs; -use std::path::{Path, PathBuf}; +use std::path::{Path, PathBuf, MAIN_SEPARATOR_STR}; use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; use std::thread; @@ -248,7 +248,7 @@ impl Refractr { let work_dir = self.set_up_work_dir(match &cfg.config.work_dir { None => { if cfg!(windows) { - PathBuf::from(format!("\"{}\\refractr\"", env::var("TEMP").unwrap())) + PathBuf::from(format!("{}\\refractr\"", env::var("TEMP").unwrap())) } else { PathBuf::from("/tmp/refractr") } @@ -303,7 +303,7 @@ impl Refractr { fo.remote_callbacks(cb); builder.fetch_options(fo); - let repo_dir = format!("{}/{}", &path_str, repo_name); + let repo_dir = format!("{}{}{}", &path_str, MAIN_SEPARATOR_STR, repo_name); let repo = match builder.clone(&cfg.config.from, Path::new(&repo_dir)) { Ok(repo) => repo, Err(_) => { @@ -319,7 +319,7 @@ impl Refractr { } }; - self.set_up_refs(&repo, &cfg.config.branches); + self.set_up_refs(&repo, &cfg.config.branches).unwrap(); self.fetch(&repo, &cfg.config.branches, Some(&cfg.config.git.ssh_identity_file)).unwrap(); let remotes = match self.make_remotes(&repo, &cfg) {