Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use \ for paths in Windows #499

Merged
merged 1 commit into from
Apr 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/cmds/repo.rs
Original file line number Diff line number Diff line change
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