chore(version): bump to 0.0.7 #7

Merged
cafkafk merged 7 commits from dev into main 2023-07-02 12:11:13 +02:00
6 changed files with 61 additions and 23 deletions
Showing only changes of commit ee8e546b22 - Show all commits

View file

@ -2,7 +2,7 @@
name = "gg" name = "gg"
version = "0.0.6" version = "0.0.6"
edition = "2021" edition = "2021"
authors = ["Christina Sørensen <christina@cafkafk.com>"] authors = ["Christina Sørensen"]
repository = "https://github.com/cafkafk/gg" repository = "https://github.com/cafkafk/gg"
license = "GPL-3.0-only" license = "GPL-3.0-only"

View file

@ -5,11 +5,11 @@
- [ ] Generic repositories - [ ] Generic repositories
- [ ] Version pinning - [ ] Version pinning
- [ ] libgit2 (maybe) - [ ] libgit2 (maybe)
* 0.1.0 [40%] [2/5] * 0.1.0 [60%] [3/5]
- [X] No functionality regressions - [X] No functionality regressions
- [X] commit works in quick, fast - [X] commit works in quick, fast
- [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 - [X] Optional Fields
- [ ] Subcommands - [ ] Subcommands

View file

@ -92,7 +92,8 @@ pub struct GitRepo {
pub name: String, pub name: String,
pub path: String, pub path: String,
pub url: String, pub url: String,
pub flags: Vec<RepoFlags>, #[serde(skip_serializing_if = "Option::is_none")]
pub flags: Option<Vec<RepoFlags>>,
} }
//////////////////////////////////// ////////////////////////////////////
@ -157,7 +158,12 @@ impl Links {
impl GitRepo { impl GitRepo {
/// Clones the repository to its specified folder. /// Clones the repository to its specified folder.
fn clone(&self) -> bool { fn clone(&self) -> bool {
if self.flags.contains(&RepoFlags::Clone) { if self
.flags
.as_ref()
.expect("failed to unwrap flags")
.contains(&RepoFlags::Clone)
{
// TODO: check if &self.name already exists in dir // TODO: check if &self.name already exists in dir
let output = Command::new("git") let output = Command::new("git")
.current_dir(&self.path) .current_dir(&self.path)
@ -176,6 +182,8 @@ impl GitRepo {
fn pull(&self) -> bool { fn pull(&self) -> bool {
if self if self
.flags .flags
.as_ref()
.expect("failed to unwrap flags")
.iter() .iter()
.any(|s| s == &RepoFlags::Pull || s == &RepoFlags::Fast) .any(|s| s == &RepoFlags::Pull || s == &RepoFlags::Fast)
{ {
@ -194,6 +202,8 @@ impl GitRepo {
fn add_all(&self) -> bool { fn add_all(&self) -> bool {
if self if self
.flags .flags
.as_ref()
.expect("failed to unwrap flags")
.iter() .iter()
.any(|s| s == &RepoFlags::Add || s == &RepoFlags::Quick || s == &RepoFlags::Fast) .any(|s| s == &RepoFlags::Add || s == &RepoFlags::Quick || s == &RepoFlags::Fast)
{ {
@ -220,6 +230,8 @@ impl GitRepo {
fn commit(&self) -> bool { fn commit(&self) -> bool {
if self if self
.flags .flags
.as_ref()
.expect("failed to unwrap flags")
.iter() .iter()
.any(|s| s == &RepoFlags::Commit || s == &RepoFlags::Quick || s == &RepoFlags::Fast) .any(|s| s == &RepoFlags::Commit || s == &RepoFlags::Quick || s == &RepoFlags::Fast)
{ {
@ -238,6 +250,8 @@ impl GitRepo {
fn commit_with_msg(&self, msg: &str) -> bool { fn commit_with_msg(&self, msg: &str) -> bool {
if self if self
.flags .flags
.as_ref()
.expect("failed to unwrap flags")
.iter() .iter()
.any(|s| s == &RepoFlags::Commit || s == &RepoFlags::Quick || s == &RepoFlags::Fast) .any(|s| s == &RepoFlags::Commit || s == &RepoFlags::Quick || s == &RepoFlags::Fast)
{ {
@ -258,6 +272,8 @@ impl GitRepo {
fn push(&self) -> bool { fn push(&self) -> bool {
if self if self
.flags .flags
.as_ref()
.expect("failed to unwrap flags")
.iter() .iter()
.any(|s| s == &RepoFlags::Push || s == &RepoFlags::Quick || s == &RepoFlags::Fast) .any(|s| s == &RepoFlags::Push || s == &RepoFlags::Quick || s == &RepoFlags::Fast)
{ {

View file

@ -150,7 +150,7 @@ mod config {
name: "test repo".to_string(), name: "test repo".to_string(),
path: "/tmp".to_string(), path: "/tmp".to_string(),
url: "https://github.com/cafkafk/gg".to_string(), url: "https://github.com/cafkafk/gg".to_string(),
flags: vec![Clone, Push], flags: Some(vec![Clone, Push]),
}, },
); );
} }

View file

@ -25,6 +25,17 @@ categories:
url: git@github.com:cafkafk/li.git url: git@github.com:cafkafk/li.git
flags: [Clone, Push] flags: [Clone, Push]
empty: empty:
stuff:
flags: []
repos:
gg:
name: gg
path: /home/ces/.dots/
url: git@github.com:cafkafk/gg.git
li:
name: li
path: /home/ces/org/src/git/
url: git@github.com:cafkafk/li.git
links: links:
- name: gg - name: gg
rx: /home/ces/.config/gg rx: /home/ces/.config/gg

View file

@ -1,5 +1,31 @@
categories: categories:
empty: {} utils:
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
stuff:
flags: []
repos:
li:
name: li
path: /home/ces/org/src/git/
url: git@github.com:cafkafk/li.git
gg:
name: gg
path: /home/ces/.dots/
url: git@github.com:cafkafk/gg.git
config: config:
flags: [] flags: []
repos: repos:
@ -17,22 +43,7 @@ categories:
flags: flags:
- Clone - Clone
- Push - Push
utils: empty: {}
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