-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cleanup): add cleaning up old backups
- Loading branch information
Showing
4 changed files
with
114 additions
and
71 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Deserialize, Serialize)] | ||
pub struct Settings { | ||
pub target_folder: String, | ||
pub backup_on_launch: bool, | ||
pub delete_old_on_launch: bool, | ||
pub backups_to_keep: i32, | ||
} | ||
|
||
impl Settings { | ||
pub fn default() -> Settings { | ||
Settings { | ||
target_folder: dirs_next::document_dir() | ||
.unwrap() | ||
.join("nexus-configs") | ||
.to_str() | ||
.unwrap() | ||
.to_string(), | ||
backup_on_launch: false, | ||
delete_old_on_launch: false, | ||
backups_to_keep: 5, | ||
} | ||
} | ||
} |