From c9ef381ff50873d9a9b18d6a50446bbd2b0a7bc4 Mon Sep 17 00:00:00 2001 From: shibedrill Date: Wed, 8 Jan 2025 23:06:18 -0500 Subject: [PATCH] exec aint working bro --- README.md | 2 +- src/command/devel.rs | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c827d8e..c26f520 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Shibe Bot 0.4.2 +# Shibe Bot 1.0.1 [![Rust](https://github.com/shibedrill/shibe-bot/actions/workflows/rust.yml/badge.svg)](https://github.com/shibedrill/shibe-bot/actions/workflows/rust.yml) [![GitHub License](https://img.shields.io/github/license/shibedrill/shibe-bot)](LICENSE.txt) diff --git a/src/command/devel.rs b/src/command/devel.rs index 9b0e523..70e7fa8 100644 --- a/src/command/devel.rs +++ b/src/command/devel.rs @@ -156,17 +156,20 @@ fn self_update() -> Result { let _ = std::fs::File::open(&new_command_path)?; } - let new_command_args: Vec<_> = std::env::args_os().skip(1).collect(); + //let new_command_args: Vec<_> = std::env::args_os().skip(1).collect(); trace!( "Got current executable path successfully: {}", new_command_path.display() ); - Err(Box::new( - std::process::Command::new(new_command_path) - .args(&new_command_args) - .exec(), - )) + let mut command = std::process::Command::new("systemctl"); + + let command = command + .arg("--user") + .arg("restart") + .arg("shibe-bot"); + + Err(Box::new(command.exec())) } mod test {