aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 981ec1e..39bc3aa 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -161,6 +161,7 @@ pub struct CmdOverrides {
pub magic_rollback: Option<bool>,
pub temp_path: Option<String>,
pub confirm_timeout: Option<u16>,
+ pub sudo: Option<String>,
pub dry_activate: bool,
}
@@ -350,7 +351,7 @@ impl<'a> DeployData<'a> {
let profile_path = self.get_profile_path()?;
let sudo: Option<String> = match self.merged_settings.user {
- Some(ref user) if user != &ssh_user => Some(format!("sudo -u {}", user)),
+ Some(ref user) if user != &ssh_user => Some(format!("{} {}", self.get_sudo(), user)),
_ => None,
};
@@ -392,6 +393,13 @@ impl<'a> DeployData<'a> {
};
Ok(profile_user)
}
+
+ fn get_sudo(&'a self) -> String {
+ return match self.merged_settings.sudo {
+ Some(ref x) => x.clone(),
+ None => "sudo -u".to_string()
+ };
+ }
}
pub fn make_deploy_data<'a, 's>(