summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2023-09-19 09:47:48 +0300
committernl6720 <nl6720@gmail.com>2023-09-19 09:47:48 +0300
commit253fff6e49f48b4baa90178593f4762cccd69f3a (patch)
tree3d776fdbda68f530992e45f53ff12c2d4a734e8f
parentf957041a37b9e98053d5c78bcdd62a1e103cdefd (diff)
parent2d6c286b4b5141665d025e2b40bc296a89a916fc (diff)
Merge remote-tracking branch 'origin/merge-requests/260'
By classabbyamp * origin/merge-requests/260: functions: fix unhelpful error for binary not found on PATH See merge request https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/merge_requests/260
-rw-r--r--functions5
1 files changed, 4 insertions, 1 deletions
diff --git a/functions b/functions
index bcb2345..a8c9103 100644
--- a/functions
+++ b/functions
@@ -745,7 +745,10 @@ add_binary() {
local line='' regex='' binary='' dest='' mode='' sodep='' resolved='' shebang='' interpreter=''
if [[ "${1:0:1}" != '/' ]]; then
- binary="$(type -P "$1")"
+ if ! binary="$(type -P "$1")"; then
+ error "binary not found: '%s'" "$1"
+ return 1
+ fi
else
binary="$1"
fi