diff --git a/CHANGELOG.md b/CHANGELOG.md index 892b2bb..776cb71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog - [Changelog](#changelog) + - [0.1.4](#014) - [0.1.3](#013) - [0.1.2](#012) - [0.1.1](#011) @@ -8,6 +9,12 @@ --- +## 0.1.4 + +Released on 18/04/2023 + +- Fixed relative paths resolve on Windows + ## 0.1.3 Released on 10/02/2023 diff --git a/Cargo.toml b/Cargo.toml index 58acd0c..489bff8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" name = "remotefs-ssh" readme = "README.md" repository = "https://github.com/veeso/remotefs-rs-ssh" -version = "0.1.3" +version = "0.1.4" [dependencies] chrono = "^0.4.19" diff --git a/README.md b/README.md index 70ab43d..f051e3e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@

~ Remotefs SSH client ~

Developed by @veeso

-

Current version: 0.1.3 (10/02/2023)

+

Current version: 0.1.4 (18/04/2023)

PathBuf { true => target.to_path_buf(), false => { let mut p: PathBuf = wrkdir.to_path_buf(); - p.push(target); + let fixed_path = resolve(target); + p.push(fixed_path); p } } } +/// Fix provided path; on Windows fixes the backslashes, converting them to slashes +/// While on POSIX does nothing +#[cfg(target_os = "windows")] +fn resolve(p: &Path) -> PathBuf { + PathBuf::from(path_slash::PathExt::to_slash_lossy(p).as_str()) +} + +#[cfg(target_family = "unix")] +fn resolve(p: &Path) -> PathBuf { + p.to_path_buf() +} + #[cfg(test)] mod test {