diff options
author | david <public@beloved.name> | 2018-07-23 19:45:17 +0200 |
---|---|---|
committer | david <public@beloved.name> | 2018-07-23 19:45:17 +0200 |
commit | 85cea3c6634e9af141612a406ba15ebca37e20db (patch) | |
tree | 5ff272e9f4068b85fcfc84c09cd72a314af20391 /subprojects/freeamo/src/get-licenses | |
parent | 29b7728d89b8c64220ffd06e268fdaa35dac7f45 (diff) |
FreeAMO: Improved terminal output
Diffstat (limited to 'subprojects/freeamo/src/get-licenses')
-rw-r--r-- | subprojects/freeamo/src/get-licenses | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/subprojects/freeamo/src/get-licenses b/subprojects/freeamo/src/get-licenses index 79b6da4..4298962 100644 --- a/subprojects/freeamo/src/get-licenses +++ b/subprojects/freeamo/src/get-licenses @@ -23,10 +23,23 @@ cd "build/json/search-pages" || exit function get-licenses--download { # API: Add "last_license" to the search pages - https://github.com/mozilla/addons-server/issues/8945 - + output_file="$output_file_1"; - pv__size="$(wc -l < "$output_file")" + + if [ "$debug" = true ]; then + + pv__size=$(cat "$output_file" | head -n 3 | wc -l) + + else + + pv__size="$(wc -l < "$output_file")" + + fi + source "$run_path/src/main_functions" + + echo "Download $pv__size current_versions files that contain license information." + while IFS= read -r table; do @@ -44,7 +57,7 @@ function get-licenses--download { # echo -e "#================== #Entry $line (of $total): $name\n" - # Do now download the same license files over and over + # Do not download the same license files over and over wget -nc -q "https://addons.mozilla.org/api/v3/addons/addon/$slug/versions/$current_version__id/" -O "$run_path/build/json/current_versions/$current_version__id.json" fi @@ -58,10 +71,21 @@ function get-licenses--download { function get-licenses--filter { output_file="$output_file_1"; - pv__size="$(wc -l < "$output_file")" + + if [ "$debug" = true ]; then + + pv__size=$(cat "$output_file" | head -n 3 | wc -l) + + else + + pv__size="$(wc -l < "$output_file")" + + fi + source "$run_path/src/main_functions" rm -f "$run_path/build/index-search-pages--free-licenses.txt" + echo "Filter free licenses for $pv__size entries." while IFS= read -r table; do |