aboutsummaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
authorRoman Melnikov2023-04-19 17:46:43 +0800
committerRoman Melnikov2023-04-20 15:13:13 +0800
commit784e9ee24d977c99dcb5ba5aef81dae48cb899fb (patch)
tree141acdf6bd62aae808f4c9542819ebc211f09ac2 /src/cli.rs
parent8c9ea9605eed20528bf60fae35a2b613b901fd77 (diff)
[Chore] Handle 'temp_path' as an actual 'Path' instead of 'String'
Problem: 'temp_path' and 'lock_path' are handled as 'String'. This can be a problem when the 'temp_path' directory is a symlink on the target system, e.g. this is the case with the default '/tmp' and macOS, where this directory is actually a symlink to '/private/tmp'. Solution: Handle 'temp_path' and 'lock_path' as actual Paths. Also, canonicalize 'temp_path' to avoid canary file path mismatches when checking filesystem events. As a side effect, also update the 'notify' dependency to the latest stable version.
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cli.rs b/src/cli.rs
index f259563..9140d6d 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -14,6 +14,7 @@ use self::deploy::{DeployFlake, ParseFlakeError};
use futures_util::stream::{StreamExt, TryStreamExt};
use log::{debug, error, info, warn};
use serde::Serialize;
+use std::path::PathBuf;
use std::process::Stdio;
use thiserror::Error;
use tokio::process::Command;
@@ -86,7 +87,7 @@ pub struct Opts {
confirm_timeout: Option<u16>,
/// Where to store temporary files (only used by magic-rollback)
#[clap(long)]
- temp_path: Option<String>,
+ temp_path: Option<PathBuf>,
/// Show what will be activated on the machines
#[clap(long)]
dry_activate: bool,