diff options
| author | 2026-02-26 16:23:29 -0500 | |
|---|---|---|
| committer | 2026-02-26 16:23:29 -0500 | |
| commit | aa1b4b75d0070c417f8c02bf35588c195b2d8254 (patch) | |
| tree | d2725b9a668d0587161e516160033432101b0d14 /src/util.rs | |
| parent | add build support (diff) | |
proper config command handling
Diffstat (limited to 'src/util.rs')
| -rw-r--r-- | src/util.rs | 28 |
1 files changed, 0 insertions, 28 deletions
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<u64> { let mut size = 0; if path.is_dir() { |
