Skip to main content

user_executable_directory

Function user_executable_directory 

Source
pub fn user_executable_directory(
    override_variable: Option<&'static str>,
) -> Option<PathBuf>
Expand description

Returns an appropriate user-level directory for storing executables.

This follows, in order:

  • $OVERRIDE_VARIABLE (if provided)
  • $XDG_BIN_HOME
  • $XDG_DATA_HOME/../bin
  • $HOME/.local/bin

On all platforms.

Returns None if a directory cannot be found, i.e., if $HOME cannot be resolved. Does not check if the directory exists.