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:
J H
2023-03-08 12:48:47 -07:00
committed by GitHub
parent 705802e584
commit ee1e92e1cb
3 changed files with 9 additions and 0 deletions

View File

@@ -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?;

View File

@@ -305,6 +305,7 @@ async fn sync_boot() -> Result<(), Error> {
force: false,
ignore_existing: true,
exclude: Vec::new(),
no_permissions: false,
},
)
.await?

View File

@@ -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));
}