frontend: do no try to look for sub-commands in the PATH

This is a recipe for disaster and it actually already fails when
you pass something that looks like a long option as first argument
because $(which --long-option) will produce an "Illegal option"
string on its standard output.

$ lb --debug config --archive-areas "main contrib non-free"
Illegal option --
/usr/bin/lb: 54: [: Usage:: unexpected operator
E: Unknown command: --debug
This commit is contained in:
Raphaël Hertzog 2020-04-23 22:26:52 +02:00
parent 10bbb095a8
commit 440c0b7738
1 changed files with 0 additions and 3 deletions

View File

@ -40,9 +40,6 @@ elif [ -x "local/live-build/scripts/build/${COMMAND}" ]; then
elif [ -x /usr/lib/live/build/${COMMAND} ]; then elif [ -x /usr/lib/live/build/${COMMAND} ]; then
# User has live-build installed in the system # User has live-build installed in the system
SCRIPT=/usr/lib/live/build/"${COMMAND}" SCRIPT=/usr/lib/live/build/"${COMMAND}"
elif [ $(which "${COMMAND}") ]; then
# User has live-build commands in path
SCRIPT="${COMMAND}"
else else
Echo_error "Unknown command: ${COMMAND}" Echo_error "Unknown command: ${COMMAND}"
exit 1 exit 1