Skip to content

Commit

Permalink
Use \ for paths in Windows (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
denisidoro committed Apr 12, 2021
1 parent eb146fb commit f352bcd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cmds/repo.rs
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f352bcd

Please sign in to comment.