aboutsummaryrefslogtreecommitdiff
path: root/subprojects
diff options
context:
space:
mode:
authordavid <public@beloved.name>2018-08-07 18:35:38 +0200
committerdavid <public@beloved.name>2018-08-07 18:35:38 +0200
commitd5355bec6b34f0dcc99d0a48c85030189e4760a2 (patch)
tree3e6c0939755f4bc51310cc0120995fdc9b0c963b /subprojects
parentb39afde5a359f59c56b8f4f01ec750288dff9fde (diff)
FreeAMO: Fixed the returned 141 error
Diffstat (limited to 'subprojects')
-rw-r--r--subprojects/freeamo/src/main_functions12
-rw-r--r--subprojects/freeamo/src/make-wiki2
2 files changed, 3 insertions, 11 deletions
diff --git a/subprojects/freeamo/src/main_functions b/subprojects/freeamo/src/main_functions
index 2e53633..32aeab1 100644
--- a/subprojects/freeamo/src/main_functions
+++ b/subprojects/freeamo/src/main_functions
@@ -67,17 +67,9 @@ function do-locale {
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
- # 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
-
+ tmp=$(jq -r ".results[$entry] | select(.$locale_description != null) | .$locale_description" "$file" | head -n 1) || [[ $? == 141 ]] # Avoid `head -n 1` error `returned 141`
+
if [ "$tmp__en_US" != "null" ]; then
diff --git a/subprojects/freeamo/src/make-wiki b/subprojects/freeamo/src/make-wiki
index e679bf7..a491f99 100644
--- a/subprojects/freeamo/src/make-wiki
+++ b/subprojects/freeamo/src/make-wiki
@@ -212,7 +212,7 @@ at https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/
fi
if ! $debug; then echo "foo"; fi # for pv
-done < "$output_file_2" | pv__progress
+done < "$output_file_2" #| pv__progress
if [ "$minimum_average_daily_users" == "100000" ]; then