feat: use $PAGER instead of less directly

This commit is contained in:
RTUnreal 2025-08-13 13:52:50 +02:00 committed by GitHub
parent f957837620
commit a763c2256e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -16,6 +16,8 @@ nix_dir="@NIX_DIR@"
version="@VERSION@"
dialog_bin="${DIALOG_BIN:-@DIALOG_BIN@}"
PAGER="${PAGER:=less}"
# Fallbacks if Nix didn't substitute
if [[ -z "${dialog_bin//@DIALOG_BIN@/}" ]]; then
# If placeholder remained, try common defaults
@ -226,7 +228,7 @@ action_view_logs() {
tmp="$(mktemp)"
lastlog="$(find "$log_dir" -type f -name '*.log' -printf '%T@ %p\n' 2>/dev/null | sort -nr | awk 'NR==1{print $2}')"
if [[ -n "${lastlog:-}" && -f "$lastlog" ]]; then
less <"$lastlog"
$PAGER <"$lastlog"
else
d_msg "No logs found in ${log_dir}"
fi