diff options
| author | 2026-02-26 22:24:15 -0500 | |
|---|---|---|
| committer | 2026-02-26 22:24:15 -0500 | |
| commit | 8c9b627d7449a53238631ec01cfcb5f778fd4e5c (patch) | |
| tree | 65ad6e1c63f3ef8256bb9914ea727723ac19c0d1 /src/util.rs | |
| parent | begin permissions shift for build commands (diff) | |
add version flag
Diffstat (limited to '')
| -rw-r--r-- | src/util.rs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/util.rs b/src/util.rs index e79124d..6f04573 100644 --- a/src/util.rs +++ b/src/util.rs @@ -27,26 +27,6 @@ pub fn get_editor() -> String { .unwrap_or_else(|_| "nano".to_string()) } -pub fn get_invoking_user_env() -> Option<(u32, u32, String, String)> { - let username = std::env::var("SUDO_USER").ok()?; - if username.is_empty() { - return None; - } - - let user = nix::unistd::User::from_name(&username).ok()??; - let uid = user.uid.as_raw(); - let gid = user.gid.as_raw(); - let home = user.dir.to_string_lossy().to_string(); - - // Reconstruct a sane PATH for the user including common tool locations - let path = format!( - "{home}/.cargo/bin:{home}/.local/bin:/usr/local/bin:/usr/bin:/bin", - home = home - ); - - Some((uid, gid, home, path)) -} - pub fn open_in_editor(editor: &str, file: &str) -> Result<(), String> { let status = Command::new(editor) .arg(file) |
