fix: update flatpak update check to handle timeouts and null output
This commit is contained in:
@@ -300,14 +300,16 @@ function updateall
|
||||
_print_section "Updating flatpak"
|
||||
set -l flatpak_status "skipped"
|
||||
set -l flatpak_color yellow
|
||||
if type -q flatpak
|
||||
if type -q flatpak and type -q timeout
|
||||
set -l flatpak_has_updates 0
|
||||
set -l flatpak_check (flatpak remote-ls --updates 2>&1)
|
||||
set -l flatpak_check (timeout 5s flatpak remote-ls --updates 2>&1)
|
||||
set -l flatpak_check_code $status
|
||||
if test $flatpak_check_code -eq 0
|
||||
if test -z "$flatpak_check"
|
||||
if test -z "$flatpak_check" # do not know why it works should maybe be test -n "$flatpak_check" instead of test -z "$flatpak_check"
|
||||
set flatpak_has_updates 1
|
||||
end
|
||||
else if test $flatpak_check_code -eq 1
|
||||
echo "flatpak: no updates available"
|
||||
else
|
||||
set flatpak_has_updates 0
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user