mirror of
https://github.com/TheLocehiliosan/yadm
synced 2024-10-27 20:34:27 +00:00
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
10
yadm
10
yadm
@ -254,8 +254,18 @@ function record_score() {
|
|||||||
# $YADM_CONFIG must be processed first, in case other templates lookup yadm configurations
|
# $YADM_CONFIG must be processed first, in case other templates lookup yadm configurations
|
||||||
if [ "$tgt" = "$YADM_CONFIG" ]; then
|
if [ "$tgt" = "$YADM_CONFIG" ]; then
|
||||||
alt_targets=("$tgt" "${alt_targets[@]}")
|
alt_targets=("$tgt" "${alt_targets[@]}")
|
||||||
|
alt_sources=("$src" "${alt_sources[@]}")
|
||||||
alt_scores=(0 "${alt_scores[@]}")
|
alt_scores=(0 "${alt_scores[@]}")
|
||||||
index=0
|
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
|
else
|
||||||
alt_targets+=("$tgt")
|
alt_targets+=("$tgt")
|
||||||
# set index to the last index (newly created one)
|
# set index to the last index (newly created one)
|
||||||
|
Loading…
Reference in New Issue
Block a user