Skip to content

Commit 00fce09

Browse files
committed
Check if MacUpdater CLI is available
1 parent bce837a commit 00fce09

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

source/info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ Workflow Environment Variables:
437437
<string></string>
438438
</dict>
439439
<key>version</key>
440-
<string>2021.1</string>
440+
<string>2021.2</string>
441441
<key>webaddress</key>
442442
<string>https://corecode.io/macupdater/</string>
443443
</dict>

source/macupdater

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,19 @@ def get_env(variable:, default:, as_bool: false, as_pathname: false, match_list:
3333
end
3434

3535
def get_outdated(mu_cli, hide_non_updatable)
36-
all = JSON.parse(Open3.capture2(mu_cli.to_path, 'list', '--json', '--hide-uptodate-apps').first)['apps']
36+
command = Open3.capture2(mu_cli.to_path, 'list', '--json', '--hide-uptodate-apps')
3737

38+
if command[1].exitstatus == 255
39+
puts({ items: [{
40+
title: 'Requires MacUpdater Pro or Business License',
41+
subtitle: 'This Workflow depends on the command-line tool, not available in Standard',
42+
valid: false
43+
}] }.to_json)
44+
45+
exit 1
46+
end
47+
48+
all = JSON.parse(command.first)['apps']
3849
return all.select { |app| app['auto_updatable'] } if hide_non_updatable
3950

4051
all

0 commit comments

Comments
 (0)