diff options
author | classabbyamp <dev@placeviolette.net> | 2023-09-15 17:02:07 -0400 |
---|---|---|
committer | classabbyamp <dev@placeviolette.net> | 2023-09-17 13:42:03 -0400 |
commit | 2d6c286b4b5141665d025e2b40bc296a89a916fc (patch) | |
tree | 3d776fdbda68f530992e45f53ff12c2d4a734e8f | |
parent | f957041a37b9e98053d5c78bcdd62a1e103cdefd (diff) |
functions: fix unhelpful error for binary not found on PATH
with the config:
```
BINARIES=(nonexistant /usr/bin/nonexistant)
```
before:
```
==> ERROR: file not found: ''
==> ERROR: file not found: '/usr/bin/nonexistant'
```
after:
```
==> ERROR: binary not found: 'nonexistant'
==> ERROR: file not found: '/usr/bin/nonexistant'
```
-rw-r--r-- | functions | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |