Skip to content

Commit

Permalink
linux: Safely exit when homebrew is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
grtcdr committed Jul 8, 2024
1 parent ef60632 commit 30abf25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,10 @@ impl LinuxPackageReadout {
base = PathBuf::from("/home/linuxbrew/.linuxbrew");
}

if !base.is_dir() {
return None;
}

match read_dir(base.join("Cellar")) {
// subtract 1 as ${base}/Cellar contains a ".keepme" file
Ok(dir) => Some(dir.count() - 1),
Expand Down

0 comments on commit 30abf25

Please sign in to comment.