From aa1b4b75d0070c417f8c02bf35588c195b2d8254 Mon Sep 17 00:00:00 2001 From: BanceDev Date: Thu, 26 Feb 2026 16:23:29 -0500 Subject: proper config command handling --- src/util.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'src/util.rs') diff --git a/src/util.rs b/src/util.rs index caa2c73..90aacb6 100644 --- a/src/util.rs +++ b/src/util.rs @@ -4,36 +4,8 @@ use std::fs; use std::io; use std::io::Write; use std::path::Path; -use std::path::PathBuf; use std::process::Command; -pub const TEMP_CONFIG_PATH: &str = "/var/lib/forge/.tmp"; - -pub fn create_config(package: &str) -> Result<(), String> { - let filename = format!("{package}.toml"); - let mut path = PathBuf::from(TEMP_CONFIG_PATH); - - if !path.exists() { - fs::create_dir_all(&path) - .map_err(|e| format!("failed to create temp config directory: {}", e))?; - } - - path.push(filename); - - let template = format!( - r#"# {package} configuration -update = "tagged" # no | live | tagged -build = "make" -install = "make install" -dependencies = [] - "# - ); - - fs::write(path, template).map_err(|e| format!("failed to create config: {}", e))?; - - Ok(()) -} - pub fn dir_size(path: &Path) -> std::io::Result { let mut size = 0; if path.is_dir() { -- cgit v1.2.3-59-g8ed1b