Merge pull request #495 from rustic-rs/windows-repo-drive

Windows: Allow repo to start with drive letter
This commit is contained in:
aawsome 2023-03-16 15:58:11 +01:00 committed by GitHub
commit 143167ca64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@ Breaking changes:
Bugs fixed:
New features:
- Experimental windows support has been added.
- New command dump has been added.
- New command merge has been added.
- Extra or wrong fields in the config file now lead to rustic complaining and aborting.

View File

@ -16,6 +16,8 @@ use ChooseBackend::{Local, Rclone, Rest};
impl ChooseBackend {
pub fn from_url(url: &str) -> Result<Self> {
Ok(match url.split_once(':') {
#[cfg(windows)]
Some((drive, _)) if drive.len() == 1 => Local(LocalBackend::new(url)?),
Some(("rclone", path)) => Rclone(RcloneBackend::new(path)?),
Some(("rest", path)) => Rest(RestBackend::new(path)?),
Some(("local", path)) => Local(LocalBackend::new(path)?),