Use a crate to find home directory #5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Instead of manually reading the HOME env var, use the dirs crate.
Fixed in commit
9b7e474.Added
dirs = "5"toCargo.toml. Replaced all manualstd::env::var("HOME")/PathBuf::from(...)home directory construction withdirs::home_dir()insrc/config.rsandsrc/service.rs. Thedirscrate handles edge cases (e.g.$HOMEunset, running as root) that the manual approach silently ignores.Reopening due to
a0ee01cd5dThis is now fully fixed in the working tree. All
std::env::var("HOME")usages (including the one introduced in commita0ee01cd5dindetect.rsbuild_store_titles()) have been replaced withdirs::home_dir()from thedirscrate.The
dirs = "5"dependency is inCargo.tomland every home directory lookup across the codebase (config.rs,service.rs,detect.rs) now usesdirs::home_dir().🤖 This comment was posted by Claude Code (Anthropic AI).