Skip to main content

stable_target

Function stable_target 

Source
pub fn stable_target(
    exe: &Path,
    resolve: impl Fn(&Path) -> Option<PathBuf>,
) -> PathBuf
Expand description

Choose the link target for the binary at the canonical path exe.

Homebrew installs into <prefix>/Cellar/stuffr/<ver>/bin/stuffr, and brew upgrade plus cleanup deletes that directory, so a link to it dangles after every upgrade. Homebrew’s stable alias for the current version is <prefix>/opt/stuffr/bin/stuffr: when exe has the Cellar shape and resolve (canonicalisation, injected for testing) takes the opt path to exe itself, that is the target. Otherwise it is exe.