1
0
mirror of https://github.com/TheLocehiliosan/yadm synced 2026-03-02 03:49:29 +00:00

Properly handle missing "." in alternate conditions

This commit is contained in:
Tim Byrne
2019-10-12 09:14:45 -05:00
parent 4ea3ed9e2a
commit 6d5467951a
3 changed files with 6 additions and 2 deletions

1
yadm
View File

@@ -148,6 +148,7 @@ function score_file() {
for field in "${fields[@]}"; do
label=${field%%.*}
value=${field#*.}
[ "$field" = "$label" ] && value="" # when .value is omitted
score=$((score + 1000))
# default condition
if [[ "$label" =~ ^(default)$ ]]; then