From 284e5586698f4e737f5fc9a404329f1ac420e991 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 28 Apr 2024 23:10:35 +0100 Subject: [PATCH] fix(xbar/mise-updated): handle no outdated tools --- xbar/mise-updates.1h.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xbar/mise-updates.1h.rb b/xbar/mise-updates.1h.rb index 8673a62..96fef65 100755 --- a/xbar/mise-updates.1h.rb +++ b/xbar/mise-updates.1h.rb @@ -4,7 +4,7 @@ # rubocop:disable Layout/LineLength # Mise Updates -# v0.0.1 +# v0.0.2 # Jim Myhrberg # jimeh # List and manage outdated tools installed with mise @@ -748,9 +748,9 @@ module Mise def outdated_list @outdated_list ||= envs.each_with_object({}) do |env, memo| - memo[env.path] = JSON.parse( - cmd(mise_path, 'outdated', '--json', dir: env.path) - ) + out = cmd(mise_path, 'outdated', '--json', dir: env.path) + out = '{}' if out.empty? + memo[env.path] = JSON.parse(out) end end end