diff options
Diffstat (limited to 'subprojects/freeamo/src/main_functions')
-rw-r--r-- | subprojects/freeamo/src/main_functions | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/subprojects/freeamo/src/main_functions b/subprojects/freeamo/src/main_functions index 789b348..2e53633 100644 --- a/subprojects/freeamo/src/main_functions +++ b/subprojects/freeamo/src/main_functions @@ -63,13 +63,21 @@ function line_status { function do-locale { -echo "####################" + echo "####################" tmp__en_US=$(jq ".results[$entry].$locale_description" "$file" | sed "s|en-US|en_US|" | jq -r .en_US ) tmp__en_GB=$(jq ".results[$entry].$locale_description" "$file" | sed "s|en-GB|en_GB|" | jq -r .en_GB ) + # Use the first avalible if English is not avaliable - tmp=$(jq -r ".results[$entry].$locale_description[]" "$file" | head -n 1) || [[ $? == 141 ]] # jq causes superfluous 141 + # Circumvent `head -n 1` error `returned 141` + echo ".results[$entry].$locale_description[]" "$file" + if ( jq -r ".results[$entry].$locale_description[]" "$file" | head -n 1 || [[ $? == 141 ]] ) | grep -q "Cannot iterate over null"; then + + tmp=$(jq -r ".results[$entry].$locale_description[]" "$file" | head -n 1) || [[ $? == 141 ]] + + fi + if [ "$tmp__en_US" != "null" ]; then @@ -152,7 +160,8 @@ echo "####################" description="$summary" fi - + + } # End locale code @@ -235,14 +244,14 @@ function pv__progress { if [ ! "$pv__discard" = true ] && ! $debug; then - (pv --progress --line-mode --size "$pv__size" --timer) > /dev/null + (pv --progress --line-mode --size "$pv__size" --timer) > /dev/null else tee - + fi - + } |