forked from inket/update_xcode_plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugins_updater.rb
57 lines (45 loc) · 1.32 KB
/
plugins_updater.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
require_relative 'xcode'
require_relative 'xcode_plugin'
class PluginsUpdater
extend CLI
def self.update_plugins
xcodes = Xcode.find_xcodes
if xcodes.empty?
error "Didn't find any Xcode installed on your system."
return
else
title 'Found:'
puts xcodes.map { |xcode| "- #{xcode.detailed_description}" }
end
separator
plugins = XcodePlugin.find_plugins
if plugins.empty?
error "Didn't find any Xcode Plug-in installed on your system."
return
else
title 'Plugins:'
puts plugins.map { |s| "- #{s}" }
end
separator
process 'Updating...'
uuids = xcodes.collect(&:uuid)
uuids.each do |uuid|
plugins.each do |plugin|
if plugin.add_uuid(uuid) && !CLI.dry_run?
success "Added #{uuid} to #{plugin}"
end
end
end
separator
success 'Finished! 🎉'
return if CLI.no_colors?
if xcodes.any? { |xcode| xcode.version.to_f >= 8 }
separator
warning 'It seems that you have Xcode 8+ installed!'
puts 'Some plugins might not work on recent versions of Xcode because of library validation.',
"See #{'https://github.com/alcatraz/Alcatraz/issues/475'.underline}"
separator
puts "Run `#{'update_xcode_plugins --unsign'.bold}` to fix this."
end
end
end