mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 09:09:03 +03:00
@@ -1,7 +1,6 @@
|
|||||||
use clap::crate_description;
|
use clap::crate_description;
|
||||||
use clap::{Arg, ArgMatches};
|
use clap::{Arg, ArgMatches};
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs::canonicalize;
|
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
@@ -47,12 +46,12 @@ fn app() -> clap::Command<'static> {
|
|||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("allow-delete")
|
Arg::new("allow-delete")
|
||||||
.long("allo-delete")
|
.long("allow-delete")
|
||||||
.help("Allow delete operation"),
|
.help("Allow delete operation"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("allow-symlink")
|
Arg::new("allow-symlink")
|
||||||
.long("allo-symlink")
|
.long("allow-symlink")
|
||||||
.help("Allow symlink to directories/files outside root directory"),
|
.help("Allow symlink to directories/files outside root directory"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
@@ -130,7 +129,7 @@ impl Args {
|
|||||||
env::current_dir()
|
env::current_dir()
|
||||||
.and_then(|mut p| {
|
.and_then(|mut p| {
|
||||||
p.push(path); // If path is absolute, it replaces the current path.
|
p.push(path); // If path is absolute, it replaces the current path.
|
||||||
canonicalize(p)
|
std::fs::canonicalize(p)
|
||||||
})
|
})
|
||||||
.or_else(|err| {
|
.or_else(|err| {
|
||||||
bail!(
|
bail!(
|
||||||
|
|||||||
@@ -444,8 +444,7 @@ impl InnerService {
|
|||||||
} else {
|
} else {
|
||||||
decoded_path.into_owned()
|
decoded_path.into_owned()
|
||||||
};
|
};
|
||||||
let fullpath = self.args.path.join(&slashes_switched);
|
Some(self.args.path.join(&slashes_switched))
|
||||||
Some(fullpath)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn to_pathitem<P: AsRef<Path>>(
|
async fn to_pathitem<P: AsRef<Path>>(
|
||||||
|
|||||||
Reference in New Issue
Block a user