Update cmd/lib/check.rb

Co-authored-by: Bo Anderson <mail@boanderson.me>
This commit is contained in:
Bevan Kay
2023-11-30 14:22:49 +11:00
committed by GitHub
co-authored by Bo Anderson
parent 93aab4d1f4
commit a45d778228
+3 -4
View File
@@ -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})"
}