mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-08 08:20:15 +00:00
self_update::detect fell back to Install::Standalone for any executable it could not place, so on macOS a Homebrew, MacPorts or Nix copy, or a program inside another app's bundle, was replaced in place, and on Windows so was a scoop, winget, Chocolatey or Store copy. The package manager's record then stays on the old version, and the bundle belongs to another app. macOS now treats executables under /opt/homebrew, /usr/local/Cellar, /usr/local/Homebrew, /usr/local/opt, /opt/local and /nix as owned by a package manager, and any executable inside an .app bundle that is not this app's own as not ours; none of them self-update. Windows does the same for scoop, winget, Chocolatey and WindowsApps folders. The rules are plain path functions, so they are tested on every platform. Tested: three new tests failed before the change (the macOS and Windows folder rules, and detect on an executable in another app's bundle) and pass after it. cargo test -p craft-update (209 tests), clippy -D warnings and fmt pass on macOS; the Windows branch was not compiled here. Fixes #390 for macOS and Windows; the Linux side is #388.