Skip to content

Commit

Permalink
Fix incorrect argument forwarding with shell verbs (#748)
Browse files Browse the repository at this point in the history
When used with bash, the previous approach would split each quoted
argument into multiple arguments, breaking commands such as
`catkin config --cmake-args -DCMAKE_CXX_FLAGS="-Ofast -DNDEBUG"`.
  • Loading branch information
MihaiBSony committed Aug 15, 2023
1 parent 9f7e5c3 commit b938b43
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions catkin_tools/verbs/catkin_shell_verbs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ function catkin() {
fi

# Capture original args
if [[ "$SHELL_EXT" == "bash" ]]; then
ORIG_ARGS=$@
else
ORIG_ARGS=(${@[*]})
fi
ORIG_ARGS=("$@")

# Handle main arguments
OPTSPEC=":hw-:"
Expand Down Expand Up @@ -100,6 +96,6 @@ function catkin() {
case "${SUBCOMMAND}" in
cd) cd "$($CATKIN locate $MAIN_ARGS $@)";;
source) source "$($CATKIN locate $MAIN_ARGS -d)/setup.$SHELL_EXT";;
*) $CATKIN ${ORIG_ARGS}
*) $CATKIN "${ORIG_ARGS[@]}"
esac
}

0 comments on commit b938b43

Please sign in to comment.