We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 697a31b commit 6bfc5a7Copy full SHA for 6bfc5a7
server/src/option.rs
@@ -199,7 +199,8 @@ pub struct Server {
199
long,
200
env = "P_STAGING_DIR",
201
default_value = "./data",
202
- value_name = "path"
+ value_name = "path",
203
+ value_parser = validation::absolute_path
204
)]
205
pub local_staging_path: PathBuf,
206
@@ -260,4 +261,11 @@ pub(self) mod validation {
260
261
262
Ok(path)
263
}
264
+
265
+ pub fn absolute_path(s: &str) -> Result<PathBuf, String> {
266
+ std::fs::canonicalize(s).map_err(|_| {
267
+ "Could not construct absolute path from given path value for staging directory"
268
+ .to_string()
269
+ })
270
+ }
271
0 commit comments