From 8c9b627d7449a53238631ec01cfcb5f778fd4e5c Mon Sep 17 00:00:00 2001 From: BanceDev Date: Thu, 26 Feb 2026 22:24:15 -0500 Subject: add version flag --- src/config.rs | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 4976af3..ecada2a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,11 +1,8 @@ use serde::Deserialize; use std::fs; -use std::os::unix::process::CommandExt; use std::path::{Path, PathBuf}; use std::process::Command; -use crate::util::get_invoking_user_env; - pub const TEMP_CONFIG_PATH: &str = "/var/lib/forge/.tmp"; pub enum ConfigCommand { @@ -70,8 +67,6 @@ pub fn run_config_command( ) -> Result<(), String> { let config = Config::new(config_path).ok_or("config not found".to_string())?; - let is_build = matches!(command, ConfigCommand::Build); - let cmd = match command { ConfigCommand::Build => config.build, ConfigCommand::Install => config.install, @@ -83,23 +78,9 @@ pub fn run_config_command( let cmd_base = parts.next().ok_or("empty command".to_string())?; let args: Vec<&str> = parts.collect(); - let mut command = Command::new(cmd_base); - command.args(&args).current_dir(repo_path); - - if is_build { - if let Some((uid, gid, home, path)) = get_invoking_user_env() { - command.env("HOME", home).env("PATH", path); - unsafe { - command.pre_exec(move || { - nix::unistd::setgid(nix::unistd::Gid::from_raw(gid))?; - nix::unistd::setuid(nix::unistd::Uid::from_raw(uid))?; - Ok(()) - }); - } - } - } - - let status = command + let status = Command::new(cmd_base) + .args(&args) + .current_dir(repo_path) .status() .map_err(|e| format!("failed to execute command: {}", e))?; -- cgit v1.2.3-59-g8ed1b