Fix bug with out-of-sync sources
The indexes of targets, scores, sources, etc. must be kept in sync.
This commit is contained in:
parent
87f81143b2
commit
ed4a4a5fbd
1 changed files with 10 additions and 0 deletions
10
yadm
10
yadm
|
@ -254,8 +254,18 @@ function record_score() {
|
|||
# $YADM_CONFIG must be processed first, in case other templates lookup yadm configurations
|
||||
if [ "$tgt" = "$YADM_CONFIG" ]; then
|
||||
alt_targets=("$tgt" "${alt_targets[@]}")
|
||||
alt_sources=("$src" "${alt_sources[@]}")
|
||||
alt_scores=(0 "${alt_scores[@]}")
|
||||
index=0
|
||||
# increase the index of any existing alt_template_cmds
|
||||
new_cmds=()
|
||||
for cmd_index in "${!alt_template_cmds[@]}"; do
|
||||
new_cmds[$((cmd_index+1))]="${alt_template_cmds[$cmd_index]}"
|
||||
done
|
||||
alt_template_cmds=()
|
||||
for cmd_index in "${!new_cmds[@]}"; do
|
||||
alt_template_cmds[$cmd_index]="${new_cmds[$cmd_index]}"
|
||||
done
|
||||
else
|
||||
alt_targets+=("$tgt")
|
||||
# set index to the last index (newly created one)
|
||||
|
|
Loading…
Reference in a new issue