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] Repo Flags Finished
- [ ] Category Flags Finished
- [ ] Optional Fields
- [-] Optional Fields
- [ ] Subcommands

View file

@ -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<RepoFlags>, // FIXME: not implemented
#[serde(skip_serializing_if = "Option::is_none")]
pub flags: Option<Vec<RepoFlags>>, // FIXME: not implemented
/// map of all categories
///
/// Key should conceptually be seen as the name of the category.

View file

@ -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 {

View file

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

View file

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