Commit 15fd9c84 authored by Marc Cornellà's avatar Marc Cornellà

style(bundler): simplify `bundled_commands` array operations

parent 98b48015
...@@ -81,14 +81,12 @@ bundled_commands=( ...@@ -81,14 +81,12 @@ bundled_commands=(
) )
# Remove $UNBUNDLED_COMMANDS from the bundled_commands list # Remove $UNBUNDLED_COMMANDS from the bundled_commands list
for cmd in $UNBUNDLED_COMMANDS; do bundled_commands=(${bundled_commands:|UNBUNDLED_COMMANDS})
bundled_commands=(${bundled_commands#$cmd}); unset UNBUNDLED_COMMANDS
done
# Add $BUNDLED_COMMANDS to the bundled_commands list # Add $BUNDLED_COMMANDS to the bundled_commands list
for cmd in $BUNDLED_COMMANDS; do bundled_commands+=($BUNDLED_COMMANDS)
bundled_commands+=($cmd); unset BUNDLED_COMMANDS
done
# Check if in the root or a subdirectory of a bundled project # Check if in the root or a subdirectory of a bundled project
_within-bundled-project() { _within-bundled-project() {
...@@ -126,5 +124,4 @@ for cmd in $bundled_commands; do ...@@ -126,5 +124,4 @@ for cmd in $bundled_commands; do
compdef "_$cmd" "bundled_$cmd"="$cmd" compdef "_$cmd" "bundled_$cmd"="$cmd"
fi fi
done done
unset cmd bundled_commands unset cmd bundled_commands
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment