Skip to main content

Module home

Module home 

Source
Expand description

Home-directory resolution and path expansion helpers.

These are crate-wide utilities (re-exported through crate::config for backward compatibility): they resolve the effective home directory, which differs from $HOME when running under sudo.

Functions§

full_expand
Like shellexpand::full but uses the effective home for both ~ and $HOME.
full_expand_with_home
Like full_expand but takes an explicit home directory instead of reading the environment. Use this when a Config is available — pass &config.home_dir to avoid a data race in tests.
tilde_expand
Expand a leading ~ using the effective home directory instead of HOME. Needed because sudo resets HOME to /root.