fix(lib/run/run.sh): encapsulate commands in runner

pull/144/head
jwerle 2 years ago
parent 650f9d277e
commit 39961dc9f6

@ -46,6 +46,14 @@ usage () {
echo ' or: bpkg-run [-s|--source] <user>/<package> [command]' echo ' or: bpkg-run [-s|--source] <user>/<package> [command]'
} }
runner () {
local cmd="$1"
shift
# shellcheck disable=SC2068
eval "$cmd"
return 0
}
bpkg_run () { bpkg_run () {
local should_emit_source=0 local should_emit_source=0
local should_source=0 local should_source=0
@ -118,7 +126,7 @@ bpkg_run () {
shift shift
# shellcheck disable=SC2068 # shellcheck disable=SC2068
eval "$prefix" ${args[@]} $@ runner "$prefix ${args[*]}" $@
return $? return $?
fi fi
fi fi
@ -193,7 +201,7 @@ bpkg_run () {
shift shift
# shellcheck disable=SC2068 # shellcheck disable=SC2068
eval "$prefix" ${args[@]} $@ runner "$prefix ${args[*]}" $@
fi fi
# shellcheck disable=SC2068 # shellcheck disable=SC2068

Loading…
Cancel
Save