Identify yadm's configuration using $YADM_CONFIG

This commit is contained in:
Tim Byrne 2020-07-08 02:03:52 -05:00
parent 7f48942934
commit b056051603
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
1 changed files with 2 additions and 3 deletions

5
yadm
View File

@ -251,9 +251,8 @@ function record_score() {
done
# if we don't find an existing index, create one by appending to the array
if [ "$index" -eq -1 ]; then
# The configuration must be the first alt of the list.
# This ensures that if any templates uses "yadm config some-confid", the config will be available.
if [ "$tgt" = "$YADM_DIR/.config/yadm/config" ]; then
# $YADM_CONFIG must be processed first, in case other templates lookup yadm configurations
if [ "$tgt" = "$YADM_CONFIG" ]; then
alt_targets=("$tgt" "${alt_targets[@]}")
alt_scores=(0 "${alt_scores[@]}")
index=0