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
3 changed files with 30 additions and 26 deletions
Showing only changes of commit e6f597e08b - Show all commits

View file

@ -9,7 +9,7 @@
- [X] No functionality regressions
- [X] commit works in quick, fast
- [X] commit with edit works
- [ ] Repo Flags Finished
- [-] Repo Flags Finished
- [ ] Category Flags Finished
- [ ] Optional Fields
- [ ] Subcommands

View file

@ -28,12 +28,16 @@ use std::{fs, process::Command};
/// An enum containing flags that change behaviour of repos and categories
#[derive(PartialOrd, Ord, PartialEq, Eq, Serialize, Deserialize, Debug)]
pub enum RepoFlags {
/// If push is set, the repository should respond to the push subcommand
Push,
/// If clone is set, the repository should respond to the clone subcommand
Clone,
/// If pull is set, the repository should respond to the pull subcommand
Pull,
/// If add is set, the repository should respond to the add subcommand
Add,
/// If commit is set, the repository should respond to the commit subcommand
Commit,
/// If push is set, the repository should respond to the push subcommand
Push,
}
/// Represents the config.toml file.
@ -174,7 +178,7 @@ impl GitRepo {
}
/// Adds all files in the repository.
fn add_all(&self) -> bool {
if self.flags.contains(&RepoFlags::Push) {
if self.flags.contains(&RepoFlags::Add) {
let output = Command::new("git")
.current_dir(format!("{}{}", &self.path, &self.name))
.arg("add")
@ -196,7 +200,7 @@ impl GitRepo {
/// easy
#[allow(dead_code)]
fn commit(&self) -> bool {
if self.flags.contains(&RepoFlags::Push) {
if self.flags.contains(&RepoFlags::Commit) {
let status = Command::new("git")
.current_dir(format!("{}{}", &self.path, &self.name))
.arg("commit")
@ -210,7 +214,7 @@ impl GitRepo {
}
/// Tries to commit changes with a message argument.
fn commit_with_msg(&self, msg: &str) -> bool {
if self.flags.contains(&RepoFlags::Push) {
if self.flags.contains(&RepoFlags::Commit) {
let output = Command::new("git")
.current_dir(format!("{}{}", &self.path, &self.name))
.arg("commit")

View file

@ -1,24 +1,14 @@
categories:
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
config:
flags: []
repos:
starship:
name: starship
path: /home/ces/org/src/git/
url: https://github.com/starship/starship.git
flags:
- Clone
- Push
qmk_firmware:
name: qmk_firmware
path: /home/ces/org/src/git/
@ -26,10 +16,20 @@ categories:
flags:
- Clone
- Push
starship:
name: starship
utils:
flags: []
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: https://github.com/starship/starship.git
url: git@github.com:cafkafk/li.git
flags:
- Clone
- Push