mirror of
https://github.com/rustic-rs/rustic.git
synced 2025-10-26 11:18:51 +00:00
config: Save config file uncompressed
This commit is contained in:
parent
73db1207ca
commit
f5c64a10fc
@ -5,6 +5,7 @@ Breaking changes:
|
||||
- Backing up multiple sources on the command line now results in one instead of several snapshots.
|
||||
|
||||
Bugs fixed:
|
||||
- `config` command did save the config file compressed which violates the repo design. This is fixed.
|
||||
|
||||
New features:
|
||||
- Experimental windows support has been added.
|
||||
|
||||
@ -12,17 +12,21 @@ pub(super) struct Opts {
|
||||
config_opts: ConfigOpts,
|
||||
}
|
||||
|
||||
pub(super) fn execute(repo: OpenRepository, opts: Opts) -> Result<()> {
|
||||
pub(super) fn execute(mut repo: OpenRepository, opts: Opts) -> Result<()> {
|
||||
let mut new_config = repo.config.clone();
|
||||
opts.config_opts.apply(&mut new_config)?;
|
||||
if new_config != repo.config {
|
||||
new_config.is_hot = None;
|
||||
// don't compress the config file
|
||||
repo.dbe.set_zstd(None);
|
||||
// for hot/cold backend, this only saves the config to the cold repo.
|
||||
repo.dbe.save_file(&new_config)?;
|
||||
|
||||
if let Some(hot_be) = repo.be_hot {
|
||||
// save config to hot repo
|
||||
let dbe = DecryptBackend::new(&hot_be, repo.key);
|
||||
let mut dbe = DecryptBackend::new(&hot_be, repo.key);
|
||||
// don't compress the config file
|
||||
dbe.set_zstd(None);
|
||||
new_config.is_hot = Some(true);
|
||||
dbe.save_file(&new_config)?;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user