sbang: Fix perl binary detection
The perl binary can also be called `perlX.Y.Z` if using a development build or simply using the versioned binary. We were also dropping all sbang arguments, since `exec $interpreter_v` was only using the first element of the `interpreter_v` array.
This commit is contained in:
parent
33d35768e6
commit
95ddd3d6f2
1 changed files with 3 additions and 3 deletions
|
@ -103,10 +103,10 @@ interpreter_f="${interpreter_v[0]}"
|
||||||
|
|
||||||
# Invoke any interpreter found, or raise an error if none was found.
|
# Invoke any interpreter found, or raise an error if none was found.
|
||||||
if [[ -n "$interpreter_f" ]]; then
|
if [[ -n "$interpreter_f" ]]; then
|
||||||
if [[ "${interpreter_f##*/}" = "perl" ]]; then
|
if [[ "${interpreter_f##*/}" = "perl"* ]]; then
|
||||||
exec $interpreter_v -x "$@"
|
exec $interpreter -x "$@"
|
||||||
else
|
else
|
||||||
exec $interpreter_v "$@"
|
exec $interpreter "$@"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "error: sbang found no interpreter in $script"
|
echo "error: sbang found no interpreter in $script"
|
||||||
|
|
Loading…
Reference in a new issue