From f352bcd1fa7b5a42d6e5c7ced15870ce9313365a Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Mon, 12 Apr 2021 08:09:03 -0300 Subject: [PATCH] Use \ for paths in Windows (#499) --- src/cmds/repo.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cmds/repo.rs b/src/cmds/repo.rs index d145a26..4dcadd4 100644 --- a/src/cmds/repo.rs +++ b/src/cmds/repo.rs @@ -7,6 +7,7 @@ use anyhow::Context; use anyhow::Error; use std::fs; use std::io::Write; +use std::path; pub fn browse(finder: &FinderChoice) -> Result<(), Error> { let repo_pathbuf = { @@ -128,8 +129,8 @@ pub fn add(uri: String, finder: &FinderChoice) -> Result<(), Error> { p }; let filename = file - .replace(&format!("{}/", &tmp_path_str), "") - .replace("/", "__"); + .replace(&format!("{}{}", &tmp_path_str, path::MAIN_SEPARATOR), "") + .replace(path::MAIN_SEPARATOR, "__"); let to = { let mut p = to_folder.clone(); p.push(filename);