use path sep

This commit is contained in:
Bryson Steck 2025-03-15 21:06:02 -06:00
parent 55f1229989
commit 8d1d3e514b
Signed by: bryson
SSH key fingerprint: SHA256:XpKABw/nP4z8UVaH+weLaBnEOD86+cVwif+QjuYLGT4

View file

@ -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) {