Class: PluginsUpdater
Class Method Summary collapse
Methods included from CLI
chown_if_required, codesign_exists?, dry_run?, install_launch_agent?, no_colors?, non_interactive?, restore_xcode?, separator, uninstall_launch_agent?, unsign_xcode?
Class Method Details
.update_plugins ⇒ Object
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 |
# File 'lib/plugins_updater.rb', line 7 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 |