Skip to content

Commit

Permalink
Merge pull request #38 from waldirborbajr/v0113
Browse files Browse the repository at this point in the history
V 0.1.13
  • Loading branch information
waldirborbajr committed Jan 23, 2024
2 parents 086815f + 46f0da1 commit be01def
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "gitpushup"
version = "0.1.12"
version = "0.1.13"
edition = "2021"
authors = ["Waldir Borba Junior <wborbajr@gmail.com>"]
description = "GitPushUp in rust!"
Expand All @@ -17,10 +17,10 @@ path = "src/main.rs"
[dependencies]
colorful = "0.2.2"
names = "0.14.0"
regex = "1.10.2"
regex = "1.10.3"

# [build]
# rustflags = ["-z", "threads=8"]
[build]
rustflags = ["-z", "threads=8"]

[profile.dev]
panic = "abort"
Expand Down
3 changes: 2 additions & 1 deletion rust-toolchain.toml
Expand Up @@ -17,5 +17,6 @@ profile = "minimal"
# use in nushell, we may opt to use the bleeding edge stable version of rust.
# I believe rust is on a 6 week release cycle and nushell is on a 4 week release cycle.
# So, every two nushell releases, this version number should be bumped by one.
channel = "nightly"
# channel = "nightly"
channel = "1.75"
components = ["rustfmt", "clippy"]
16 changes: 10 additions & 6 deletions rustfmt.toml
@@ -1,14 +1,18 @@
edition = "2021"
format_code_in_doc_comments = true
format_macro_matchers = true
format_strings = true
group_imports = "StdExternalCrate"
# imports_granularity = "One"
imports_granularity = "Module"
match_arm_leading_pipes = "Preserve"
imports_granularity = "One"
#imports_granularity = "Module"
normalize_doc_attributes = true
reorder_impl_items = true
tab_spaces = 2
unstable_features = true
#
edition = "2021"
max_width = 120
# max_width = 80
use_small_heuristics = "Max"
use_field_init_shorthand = true
match_arm_leading_pipes = "Preserve"
#
group_imports = "StdExternalCrate"
reorder_impl_items = true
16 changes: 6 additions & 10 deletions src/git.rs
Expand Up @@ -20,8 +20,7 @@ pub fn gitpush(message: &str) {
false => (),
}

let add_command =
Command::new("git").arg("add").arg("-A").output().expect("Failed to execute git add command");
let add_command = Command::new("git").arg("add").arg("-A").output().expect("Failed to execute git add command");

match !add_command.status.success() {
true => {
Expand All @@ -31,12 +30,8 @@ pub fn gitpush(message: &str) {
false => (),
}

let commit_command = Command::new("git")
.arg("commit")
.arg("-m")
.arg(message)
.output()
.expect("Failed to execute git commit command");
let commit_command =
Command::new("git").arg("commit").arg("-m").arg(message).output().expect("Failed to execute git commit command");

match !commit_command.status.success() {
true => {
Expand Down Expand Up @@ -72,11 +67,12 @@ pub fn gitpush(message: &str) {

match !push_command.status.success() {
true => {
eprintln!("{}", "Error: Failed to push changes to git repository.".red().bold());
eprintln!("{}", "🛑 Error: Failed to push changes to git repository.".red().bold());
std::process::exit(1);
}
false => (),
}

println!("{}", "Successfully added, committed, and pushed changes!".yellow())
println!("{}", "🚀 Successfully added, committed, and pushed changes!".yellow());
std::process::exit(0)
}
2 changes: 1 addition & 1 deletion src/main.rs
Expand Up @@ -31,5 +31,5 @@ fn main() {
// add + commit + push
gitpush(&message);

std::process::exit(0)
// std::process::exit(0)
}

0 comments on commit be01def

Please sign in to comment.