Skip to content

Commit

Permalink
Fix extension registration when error_if_exists is false
Browse files Browse the repository at this point in the history
  • Loading branch information
miklschmidt committed Jan 4, 2024
1 parent 4a5cdba commit 37a8fa4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/ratos-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ _register_klippy_extension() {
EXT_PATH=$2
EXT_FILE=$3
ERROR_IF_EXISTS=$4
[[ "$ERROR_IF_EXISTS" == "false" ]] && ERROR_IF_EXISTS="" || ERROR_IF_EXISTS="-e"
[[ "$ERROR_IF_EXISTS" == "false" ]] && ERROR_IF_EXISTS="" || ERROR_IF_EXISTS="-e "

report_status "Registering klippy extension '$EXT_NAME' with the RatOS Configurator..."
if [ ! -e "$EXT_PATH/$EXT_FILE" ]
Expand All @@ -63,7 +63,8 @@ _register_klippy_extension() {
exit 1
fi

if ! ratos extensions register klipper "$ERROR_IF_EXISTS" "$EXT_NAME" "$EXT_PATH"/"$EXT_FILE"
# shellcheck disable=SC2086
if ! ratos extensions register klipper $ERROR_IF_EXISTS"$EXT_NAME" "$EXT_PATH"/"$EXT_FILE"
then
echo "ERROR: Failed to register $EXT_NAME. Is the RatOS configurator running?"
exit 1
Expand Down

0 comments on commit 37a8fa4

Please sign in to comment.