From 93aab4d1f4778e2c47d3aec1558b99e3185d1bca Mon Sep 17 00:00:00 2001 From: Bevan Kay Date: Thu, 30 Nov 2023 12:34:25 +1100 Subject: [PATCH 1/2] `cmd/lib/check` suppress stderr --- cmd/lib/check.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/lib/check.rb b/cmd/lib/check.rb index e39b571540..f44a9958e1 100644 --- a/cmd/lib/check.rb +++ b/cmd/lib/check.rb @@ -29,7 +29,9 @@ module Check format_launchjob = lambda { |file| name = file.basename(".plist").to_s - xml, = system_command! "plutil", args: ["-convert", "xml1", "-o", "-", "--", file], sudo: true + xml, = system_command! "plutil", args: ["-convert", "xml1", "-o", "-", "--", file], + print_stderr: false, + sudo: true label = Plist.parse_xml(xml)["Label"] (name == label) ? name : "#{name} (#{label})" From a45d77822894b49361bbd85a9ca3300b6d66ab17 Mon Sep 17 00:00:00 2001 From: Bevan Kay Date: Thu, 30 Nov 2023 14:22:49 +1100 Subject: [PATCH 2/2] Update cmd/lib/check.rb Co-authored-by: Bo Anderson --- cmd/lib/check.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/lib/check.rb b/cmd/lib/check.rb index f44a9958e1..d44b502b66 100644 --- a/cmd/lib/check.rb +++ b/cmd/lib/check.rb @@ -29,11 +29,10 @@ module Check format_launchjob = lambda { |file| name = file.basename(".plist").to_s - xml, = system_command! "plutil", args: ["-convert", "xml1", "-o", "-", "--", file], - print_stderr: false, - sudo: true + result = system_command "plutil", args: ["-convert", "xml1", "-o", "-", "--", file], sudo: true + return name unless result.success? - label = Plist.parse_xml(xml)["Label"] + label = result.plist["Label"] (name == label) ? name : "#{name} (#{label})" }