mirror of
https://github.com/termux/termux-packages.git
synced 2025-10-16 03:35:36 +00:00
Previously it would override any previously set command_not_found hook by the user (or any other program). Now it just adds a new hook alongside the previous hook
13 lines
405 B
Nu
13 lines
405 B
Nu
do --env {
|
|
# Handles nonexistent commands.
|
|
# If user has entered command which invokes non-available
|
|
# utility, command-not-found will give a package suggestions.
|
|
let cnf = '@TERMUX_PREFIX@/libexec/termux/command-not-found'
|
|
if ($cnf | path exists) {
|
|
$env.config.hooks.command_not_found = $env.config.hooks.command_not_found
|
|
| default [] | append {|cmd|
|
|
run-external $cnf $cmd | print
|
|
}
|
|
}
|
|
}
|