mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
feat: No pemissions for the rsync (#2187)
* feat: No pemissions for the rsync * chore: Fix the build for missing a property
This commit is contained in:
@@ -467,6 +467,7 @@ async fn migrate(
|
||||
force: true,
|
||||
ignore_existing: false,
|
||||
exclude: Vec::new(),
|
||||
no_permissions: false,
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
@@ -478,6 +479,7 @@ async fn migrate(
|
||||
force: true,
|
||||
ignore_existing: false,
|
||||
exclude: vec!["tmp".to_owned()],
|
||||
no_permissions: false,
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -305,6 +305,7 @@ async fn sync_boot() -> Result<(), Error> {
|
||||
force: false,
|
||||
ignore_existing: true,
|
||||
exclude: Vec::new(),
|
||||
no_permissions: false,
|
||||
},
|
||||
)
|
||||
.await?
|
||||
|
||||
@@ -21,6 +21,8 @@ pub struct RsyncOptions {
|
||||
pub ignore_existing: bool,
|
||||
#[serde(default)]
|
||||
pub exclude: Vec<String>,
|
||||
#[serde(default = "const_true")]
|
||||
pub no_permissions: bool,
|
||||
}
|
||||
impl Default for RsyncOptions {
|
||||
fn default() -> Self {
|
||||
@@ -29,6 +31,7 @@ impl Default for RsyncOptions {
|
||||
force: true,
|
||||
ignore_existing: false,
|
||||
exclude: Vec::new(),
|
||||
no_permissions: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +58,9 @@ impl Rsync {
|
||||
if options.ignore_existing {
|
||||
cmd.arg("--ignore-existing");
|
||||
}
|
||||
if options.no_permissions {
|
||||
cmd.arg("--no-perms");
|
||||
}
|
||||
for exclude in options.exclude {
|
||||
cmd.arg(format!("--exclude={}", exclude));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user