{"record":{"id":"3c4ef5cf4d6fca59","repo":"Canop/broot","slug":"no-home-directory","errorCode":null,"errorMessage":"no home directory!","messagePattern":"no home directory!","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/shell_install/bash.rs","lineNumber":94,"sourceCode":"/// return the path to the script containing the function.\n///\n/// At version 0.10.4 we change the location of the script:\n/// It was previously with the link, but it's now in\n/// XDG_DATA_HOME (typically ~/.local/share on linux)\nfn get_script_path() -> PathBuf {\n    conf::app_dirs()\n        .data_dir()\n        .join(\"launcher\")\n        .join(NAME)\n        .join(VERSION)\n}\n\n/// return the paths to the files in which the br function is sourced.\n/// Paths in SOURCING_FILES can be absolute or relative to the home\n/// directory. Environment variables designed as $NAME are interpolated.\nfn get_sourcing_paths() -> Vec<PathBuf> {\n    let homedir_path = UserDirs::new()\n        .expect(\"no home directory!\")\n        .home_dir()\n        .to_path_buf();\n    SOURCING_FILES\n        .iter()\n        .map(|name| {\n            regex!(r#\"\\$(\\w+)\"#)\n                .replace(name, |c: &Captures<'_>| {\n                    env::var(&c[1]).unwrap_or_else(|_| (*name).to_string())\n                })\n                .to_string()\n        })\n        .map(PathBuf::from)\n        .map(|path| {\n            if path.is_absolute() {\n                path\n            } else {\n                homedir_path.join(path)\n            }","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/Canop/broot/blob/17204794d7c564f21d023c31f105c09ac169dd2d/src/shell_install/bash.rs#L76-L112","documentation":"Panic in get_sourcing_paths when the user's home directory cannot be determined (the home-dir lookup returns None). The function needs the home path to resolve SOURCING_FILES entries that are relative to home (like .bashrc) before interpolating environment variables, so installation of the br shell function cannot proceed without it.","triggerScenarios":"Thrown at src/shell_install/bash.rs:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the HOME environment variable is set and points to an existing directory","Run `broot install` from a normal user shell rather than a stripped environment (cron, systemd service, chroot)","Alternatively use absolute paths in the shell-install sourcing configuration to avoid home-relative resolution"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17204794d7c564f21d023c31f105c09ac169dd2d","analyzedAt":"2026-09-08T00:58:21.814Z","contentChangedAt":"2026-09-08T00:58:21.814Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}