From 88ab8cc0138d78070004b5cd4aa67d999339021a Mon Sep 17 00:00:00 2001 From: Elouan Da Costa Peixoto Date: Fri, 20 Jun 2025 11:57:47 +0200 Subject: [PATCH 1/3] feat: change git pull command --- src/git/mod.rs | 11 +++++++---- src/upgrade/mod.rs | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/git/mod.rs b/src/git/mod.rs index 8ccc4b1..88d3686 100644 --- a/src/git/mod.rs +++ b/src/git/mod.rs @@ -1,4 +1,4 @@ -use std::process::Command; +use std::process::{Command, Stdio}; use crate::env; use crate::nxfs::config::LogLevel; @@ -139,12 +139,15 @@ fn show_stash() { } pub fn git_pull() { - let mut pull = Command::new("git") + let pull = Command::new("git") .arg("pull") + .stdout(Stdio::piped()) .spawn() .expect("Failed to execute pull command"); - let wait_pull = pull.wait().expect("Failed to wait pull command"); - if !wait_pull.success() { + let wait_pull = pull + .wait_with_output() + .expect("Failed to wait pull command"); + if !wait_pull.status.success() { log_from_log_level(LogLevel::Error, "Failed to pull from remote repository"); } } diff --git a/src/upgrade/mod.rs b/src/upgrade/mod.rs index ecac672..95efa35 100644 --- a/src/upgrade/mod.rs +++ b/src/upgrade/mod.rs @@ -8,8 +8,8 @@ use throbber::Throbber; /// Check if there's a new version of nyx and if so update the current one pub fn upgrade_bin() { change_work_dir(&utils::env::get_nyx_env_var()); - git::git_pull(); let nyx_art = utils::nyx_ascii_art(); + git::git_pull(); // throbber let mut building_throbber = Throbber::new() .message("Building latest NYX binary...".to_owned()) From 57afba7a322eb9eb28a416d46fcc70bd945c357f Mon Sep 17 00:00:00 2001 From: Luern <78272327+LuernOutOfOrder@users.noreply.github.com> Date: Fri, 20 Jun 2025 12:00:48 +0200 Subject: [PATCH 2/3] Update mod.rs --- src/git/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/git/mod.rs b/src/git/mod.rs index 88d3686..deaff44 100644 --- a/src/git/mod.rs +++ b/src/git/mod.rs @@ -138,6 +138,7 @@ fn show_stash() { println!("{}", str::from_utf8(&list.stdout).unwrap()); } +/// Spawn git pull process pub fn git_pull() { let pull = Command::new("git") .arg("pull") From 65945a12a050b75ecc2d99e2c9519478ddee9e91 Mon Sep 17 00:00:00 2001 From: Elouan Da Costa Peixoto Date: Fri, 20 Jun 2025 12:04:07 +0200 Subject: [PATCH 3/3] fix: git pull command --- src/upgrade/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/upgrade/mod.rs b/src/upgrade/mod.rs index 95efa35..f64672c 100644 --- a/src/upgrade/mod.rs +++ b/src/upgrade/mod.rs @@ -9,7 +9,6 @@ use throbber::Throbber; pub fn upgrade_bin() { change_work_dir(&utils::env::get_nyx_env_var()); let nyx_art = utils::nyx_ascii_art(); - git::git_pull(); // throbber let mut building_throbber = Throbber::new() .message("Building latest NYX binary...".to_owned()) @@ -18,6 +17,8 @@ pub fn upgrade_bin() { .message("Updating NYX...".to_owned()) .frames(&throbber::ROTATE_F); println!("{}", nyx_art.truecolor(138, 43, 226)); + println!("Pulling from remote repository..."); + git::git_pull(); building_throbber.start(); // nyx version