feat(command-not-found): add alpine support (#13864)

This commit is contained in:
Session小胡 2026-08-05 18:10:52 +08:00 committed by GitHub
commit a8afe14b93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -32,5 +32,6 @@ It works out of the box with the command-not-found packages for:
- [SUSE](https://www.unix.com/man-page/suse/1/command-not-found/)
- [Gentoo](https://github.com/AndrewAmmerlaan/command-not-found-gentoo/tree/main)
- [Void Linux](https://codeberg.org/classabbyamp/xbps-command-not-found)
- [Alpine Linux](https://pkgs.alpinelinux.org/package/edge/main/x86_64/command-not-found)
You can add support for other platforms by submitting a Pull Request.

View file

@ -74,3 +74,10 @@ if [[ -x /usr/bin/command-not-found ]]; then
/usr/bin/command-not-found "$1"
}
fi
# Alpine: https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/command-not-found/APKBUILD
if [[ -x /usr/libexec/command-not-found ]]; then
command_not_found_handler() {
/usr/libexec/command-not-found "$1"
}
fi