File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 102102_zmkbuild () {
103103 i=0
104104 for board in $( yq " .include[].board" " $build_file " ) ; do
105- for var in shield cmake_args west_args env_args; do
105+ for var in shield cmake_args west_args env_args name ; do
106106 val=" $( yq " .include[$i ].${var} " " $build_file " ) "
107107 export $var =" $val "
108108 if [ " $val " = " null" ]; then
109109 unset $var
110110 fi
111111 done
112- # TODO: somehow fix naming
113- # shellcheck disable=SC2154
114- build_dir=" $ZMK_CONFIG_DIR /$( echo " build/$board .$shield " | sed ' s/ /_/g' ) "
112+
113+ if [ -n " $name " ]; then
114+ # TODO: solve duplicate names or just behaviour is overwrite/unexpected
115+ build_dir=" $ZMK_CONFIG_DIR /$( echo " build/$name " | sed ' s/ /_/g' ) "
116+ else
117+ # shellcheck disable=SC2154
118+ placeholder=" $( echo " build/$board .$shield " | sed ' s/ /_/g' ) "
119+
120+ index=0
121+ for n in $name_exists ; do
122+ if [ " $n " = " $placeholder " ]; then
123+ index=$(( index + 1 ))
124+ fi
125+ done
126+ if [ $index -eq 0 ]; then
127+ index=" "
128+ fi
129+
130+ build_dir=" $ZMK_CONFIG_DIR /$placeholder$index "
131+ name_exists=" $name_exists $placeholder "
132+ fi
115133
116134 mkdir -p " $build_dir "
117135 fifo=" $build_dir /fifo"
You can’t perform that action at this time.
0 commit comments