File tree 3 files changed +23
-14
lines changed
opt/rapids-build-utils/bin
3 files changed +23
-14
lines changed Original file line number Diff line number Diff line change 96
96
97
97
# Install bash_completion script
98
98
if command -v devcontainer-utils-generate-bash-completion > /dev/null 2>&1 ; then
99
- devcontainer-utils-generate-bash-completion \
100
- --out-file /etc/bash_completion.d/rapids-build-utils-completions \
101
- ${commands[@]/#/ --command rapids-} \
102
- ;
99
+ read -ra commands <<< " ${commands[*]/#/--command rapids-}" ;
100
+ if test " ${# commands[@]} " -gt 0; then
101
+ devcontainer-utils-generate-bash-completion \
102
+ --out-file /etc/bash_completion.d/rapids-build-utils-completions \
103
+ " ${commands[@]} " \
104
+ ;
105
+ fi
103
106
fi
104
107
105
108
find /opt/rapids-build-utils \
Original file line number Diff line number Diff line change @@ -17,12 +17,15 @@ generate_completions() {
17
17
. devcontainer-utils-debug-output ' rapids_build_utils_debug' ' generate-scripts' ;
18
18
19
19
readarray -t commands < <( find " ${TMP_SCRIPT_DIR} " / -maxdepth 1 -type f -exec basename {} \; ) ;
20
-
21
- devcontainer-utils-generate-bash-completion \
22
- --out-file " $( realpath -m " ${COMPLETION_FILE} " ) " \
23
- --template " $( realpath -m " ${COMPLETION_TMPL} " ) " \
24
- ${commands[@]/#/ --command } \
25
- ;
20
+ read -ra commands <<< " ${commands[*]/#/--command }" ;
21
+
22
+ if test " ${# commands[@]} " -gt 0; then
23
+ devcontainer-utils-generate-bash-completion \
24
+ --out-file " $( realpath -m " ${COMPLETION_FILE} " ) " \
25
+ --template " $( realpath -m " ${COMPLETION_TMPL} " ) " \
26
+ " ${commands[@]} " \
27
+ ;
28
+ fi
26
29
fi
27
30
}
28
31
Original file line number Diff line number Diff line change @@ -125,10 +125,13 @@ done
125
125
declare -a commands=" ($( for pair in " ${commands_and_sources[@]} " ; do cut -d' ' -f1 <<< " ${pair}" ; done) )" ;
126
126
127
127
# Install bash_completion script
128
- devcontainer-utils-generate-bash-completion \
129
- --out-file /etc/bash_completion.d/devcontainer-utils-completions \
130
- ${commands[@]/#/ --command devcontainer-utils-} \
131
- ;
128
+ read -ra commands <<< " ${commands[*]/#/--command devcontainer-utils-}" ;
129
+ if test " ${# commands[@]} " -gt 0; then
130
+ devcontainer-utils-generate-bash-completion \
131
+ --out-file /etc/bash_completion.d/devcontainer-utils-completions \
132
+ " ${commands[@]} " \
133
+ ;
134
+ fi
132
135
133
136
find /opt/devcontainer \
134
137
\( -type d -exec chmod 0775 {} \; \
You can’t perform that action at this time.
0 commit comments