diff --git a/README.md b/README.md index 6189481..553e72e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Refer to the documentation for installation and setup instructions: - [GitHub](https://aclist.github.io/dzgui/dzgui.html) - [Mirror (Codeberg)](https://aclist.codeberg.page) + ![A screenshot of DZGUI](/images/example.png) ## Attribution diff --git a/dzgui.sh b/dzgui.sh index e0298ad..43af009 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o pipefail -version=5.6.0 +version=5.6.1 #CONSTANTS aid=221100 @@ -76,6 +76,9 @@ set_im_module(){ return fi } +redact(){ + sed 's@\(/home/\)[^/]*@\1REDACTED@g' +} logger(){ local date="$(date "+%F %T,%3N")" local tag="$1" @@ -83,8 +86,8 @@ logger(){ local self="${BASH_SOURCE[0]}" local caller="${FUNCNAME[1]}" local line="${BASH_LINENO[0]}" - self="$(<<< "$self" sed 's@\(/[^/]*/\)\([^/]*\)\(.*\)@\1REDACTED\3@g')" - printf "%s␞%s␞%s::%s()::%s␞%s\n" "$date" "$tag" "$self" "$caller" "$line" "$string" >> "$debug_log" + printf "%s␞%s␞%s::%s()::%s␞%s\n" "$date" "$tag" "$self" "$caller" "$line" "$string" \ + | redact >> "$debug_log" } setup_dirs(){ for dir in "$state_path" "$cache_path" "$share_path" "$helpers_path" "$freedesktop_path" "$config_path" "$log_path"; do @@ -587,7 +590,7 @@ fetch_helpers_by_sum(){ ["ui.py"]="d3ad9153d8599bea0eede9fd3121ee8e" ["query_v2.py"]="55d339ba02512ac69de288eb3be41067" ["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397" - ["funcs"]="baa2c9c93edacb98384ae9f319e3b27f" + ["funcs"]="6a1c7ce585d9b76e2e75dba9d4295f8d" ["lan"]="c62e84ddd1457b71a85ad21da662b9af" ) local author="aclist" diff --git a/helpers/funcs b/helpers/funcs index b23c1f2..0c227c3 100755 --- a/helpers/funcs +++ b/helpers/funcs @@ -447,7 +447,9 @@ get_remote_servers(){ _fetch "${params[$i]}" > $_cache_temp.${i} done - jq -n '[ [inputs]|add ].[]' $_cache_temp.* && rm $_cache_temp.* + # ubuntu variants do not support jq 1.7 chained operators + # https://github.com/jqlang/jq/releases/tag/jq-1.7 + jq -n '[ [inputs]|add ][]' $_cache_temp.* && rm $_cache_temp.* } get_unique_maps(){ shift @@ -735,6 +737,9 @@ dump_servers(){ logger INFO "Server context is '$subcontext', reading from file '$file'" filter_servers "$file" "$@" } +redact(){ + sed 's@\(/home/\)[^/]*@\1REDACTED@g' +} logger(){ local date="$(date "+%F %T,%3N")" local tag="$1" @@ -742,8 +747,8 @@ logger(){ local self="${BASH_SOURCE[0]}" local caller="${FUNCNAME[1]}" local line="${BASH_LINENO[0]}" - self="$(<<< "$self" sed 's@\(/[^/]*/\)\([^/]*\)\(.*\)@\1REDACTED\3@g')" - printf "%s␞%s␞%s::%s()::%s␞%s\n" "$date" "$tag" "$self" "$caller" "$line" "$string" >> "$debug_log" + printf "%s␞%s␞%s::%s()::%s␞%s\n" "$date" "$tag" "$self" "$caller" "$line" "$string" \ + | redact >> "$debug_log" } test_ping(){ shift @@ -1243,8 +1248,8 @@ symlinks(){ done } - readarray -t mods < <(find $workshop_dir -mindepth 1 -name meta.cpp | awk -F/ 'NF=NF-1{print $NF}') - readarray -t links < <(find $game_dir -type l) + readarray -t mods < <(find "$workshop_dir" -mindepth 1 -name meta.cpp | awk -F/ 'NF=NF-1{print $NF}') + readarray -t links < <(find "$game_dir" -maxdepth 1 -type l) if [[ ${#mods[@]} -eq 0 ]]; then logger INFO "No mods present, aborting"