feat(git): made category flags optional

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
Christina Sørensen 2023-07-02 11:23:00 +02:00
parent ec49c90a0e
commit a000d37b72
Signed by: cafkafk
GPG key ID: CDDC792F655251ED
5 changed files with 20 additions and 21 deletions

View file

@ -11,5 +11,5 @@
- [X] commit with edit works - [X] commit with edit works
- [X] Repo Flags Finished - [X] Repo Flags Finished
- [ ] Category Flags Finished - [ ] Category Flags Finished
- [ ] Optional Fields - [-] Optional Fields
- [ ] Subcommands - [ ] Subcommands

View file

@ -68,7 +68,8 @@ pub struct Config {
/// This allows you to organize your repositories into categories /// This allows you to organize your repositories into categories
#[derive(PartialEq, Debug, Serialize, Deserialize)] #[derive(PartialEq, Debug, Serialize, Deserialize)]
pub struct Category { pub struct Category {
pub flags: Vec<RepoFlags>, // FIXME: not implemented #[serde(skip_serializing_if = "Option::is_none")]
pub flags: Option<Vec<RepoFlags>>, // FIXME: not implemented
/// map of all categories /// map of all categories
/// ///
/// Key should conceptually be seen as the name of the category. /// Key should conceptually be seen as the name of the category.

View file

@ -126,7 +126,7 @@ mod config {
#[test] #[test]
fn init_config_populate() { fn init_config_populate() {
let default_category = Category { let default_category = Category {
flags: vec![], flags: Some(vec![]),
repos: HashMap::new(), repos: HashMap::new(),
}; };
let mut config = Config { let mut config = Config {

View file

@ -13,7 +13,6 @@ categories:
url: https://github.com/starship/starship.git url: https://github.com/starship/starship.git
flags: [Clone, Push] flags: [Clone, Push]
utils: utils:
flags: []
repos: repos:
gg: gg:
name: gg name: gg

View file

@ -1,4 +1,20 @@
categories: categories:
utils:
repos:
gg:
name: gg
path: /home/ces/.dots/
url: git@github.com:cafkafk/gg.git
flags:
- Clone
- Push
li:
name: li
path: /home/ces/org/src/git/
url: git@github.com:cafkafk/li.git
flags:
- Clone
- Push
config: config:
flags: [] flags: []
repos: repos:
@ -16,23 +32,6 @@ categories:
flags: flags:
- Clone - Clone
- Push - Push
utils:
flags: []
repos:
li:
name: li
path: /home/ces/org/src/git/
url: git@github.com:cafkafk/li.git
flags:
- Clone
- Push
gg:
name: gg
path: /home/ces/.dots/
url: git@github.com:cafkafk/gg.git
flags:
- Clone
- Push
links: links:
- name: gg - name: gg
rx: /home/ces/.config/gg rx: /home/ces/.config/gg