@@ -77,20 +77,33 @@ yaml_get_commands() {
7777 fi
7878
7979 awk -v section=" $section " '
80+ function emit() {
81+ if (name != "" && cmd != "") {
82+ print name "|" cmd "|" cmd_docker
83+ name=""; cmd=""; cmd_docker=""
84+ }
85+ }
8086 $0 ~ "^"section":" { in_section=1; next }
81- in_section && /^[a-zA-Z]/ { in_section=0 }
87+ in_section && /^[a-zA-Z]/ { emit(); in_section=0; in_commands =0 }
8288 in_section && /^ commands:/ { in_commands=1; next }
83- in_commands && /^ [a-zA-Z]/ { in_commands=0 }
89+ in_commands && /^ [a-zA-Z]/ { emit(); in_commands=0 }
8490 in_commands && /^ - name:/ {
91+ emit()
8592 gsub(/^ - name:[ ]*/, "")
8693 gsub(/^["' \' ' ]|["' \' ' ]$/, "")
8794 name=$0
8895 }
8996 in_commands && /^ run:/ {
9097 gsub(/^ run:[ ]*/, "")
9198 gsub(/^["' \' ' ]|["' \' ' ]$/, "")
92- print name "|" $0
99+ cmd=$0
100+ }
101+ in_commands && /^ docker:/ {
102+ gsub(/^ docker:[ ]*/, "")
103+ gsub(/^["' \' ' ]|["' \' ' ]$/, "")
104+ cmd_docker=$0
93105 }
106+ END { emit() }
94107 ' " $file "
95108}
96109
@@ -240,14 +253,16 @@ run_commands() {
240253 [ -z " $line " ] && continue
241254
242255 local name=" ${line%% |* } "
243- local cmd=" ${line#* |} "
256+ local rest=" ${line#* |} "
257+ local cmd=" ${rest%% |* } "
258+ local cmd_docker=" ${rest##* |} "
244259
245260 echo -e " ${BLUE} ▶${NC} ${WHITE}${BOLD}${name}${NC} "
246261 echo -e " ${DIM}${cmd}${NC} "
247262
248263 local full_cmd=" $cmd "
249264
250- if [ " $docker_enabled " = " true" ]; then
265+ if [ " $docker_enabled " = " true" ] && [ " $cmd_docker " != " false " ] ; then
251266 if [ " $docker_compose " = " true" ]; then
252267 full_cmd=" docker-compose -f $compose_file exec -T $docker_container $cmd "
253268 else
0 commit comments