diff --git a/doc/roadmap.org b/doc/roadmap.org index ed169b8..eba028b 100644 --- a/doc/roadmap.org +++ b/doc/roadmap.org @@ -11,5 +11,5 @@ - [X] commit with edit works - [X] Repo Flags Finished - [ ] Category Flags Finished -- [ ] Optional Fields +- [-] Optional Fields - [ ] Subcommands diff --git a/src/git.rs b/src/git.rs index f806c08..620a658 100644 --- a/src/git.rs +++ b/src/git.rs @@ -68,7 +68,8 @@ pub struct Config { /// This allows you to organize your repositories into categories #[derive(PartialEq, Debug, Serialize, Deserialize)] pub struct Category { - pub flags: Vec, // FIXME: not implemented + #[serde(skip_serializing_if = "Option::is_none")] + pub flags: Option>, // FIXME: not implemented /// map of all categories /// /// Key should conceptually be seen as the name of the category. diff --git a/src/main.rs b/src/main.rs index 68d6816..087e4fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -126,7 +126,7 @@ mod config { #[test] fn init_config_populate() { let default_category = Category { - flags: vec![], + flags: Some(vec![]), repos: HashMap::new(), }; let mut config = Config { diff --git a/src/test/config.yaml b/src/test/config.yaml index c53665b..91aa884 100644 --- a/src/test/config.yaml +++ b/src/test/config.yaml @@ -13,7 +13,6 @@ categories: url: https://github.com/starship/starship.git flags: [Clone, Push] utils: - flags: [] repos: gg: name: gg diff --git a/src/test/test.yaml b/src/test/test.yaml index b8dd2eb..89fb77d 100644 --- a/src/test/test.yaml +++ b/src/test/test.yaml @@ -1,4 +1,20 @@ 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: flags: [] repos: @@ -16,23 +32,6 @@ categories: flags: - Clone - 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: - name: gg rx: /home/ces/.config/gg