Skip to main content

stable_exe_path

Function stable_exe_path 

Source
pub fn stable_exe_path() -> PathBuf
Expand description

Absolute path to a copy of this binary that will still be there next week.

Anything that writes a path down for later — the OS scheduler, the git hooks — has to use this instead of std::env::current_exe. dev-prune ships through npm and PyPI as well as the installers, so the running executable is often somewhere a package manager owns and will delete: npm’s _npx cache, uv’s ephemeral tool environment, or target/debug during development. An entry recorded there breaks the moment that directory goes, and neither of these has anywhere to complain — the scheduled task fails silently every interval, and the hook discards its own output by design. The only symptom is that nothing ever happens again.

<config>/bin is where install.sh and install.ps1 put the binary and nothing else deletes, so prefer the copy there. When there is none, put one there: the binary that is running right now is precisely the one that is going to be missing later.