415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
|
# File 'lib/xccleanup.rb', line 415
def self.()
line('–')
center('🗑 XCODE CLEANUP 🗑')
line('–')
puts "This script can perform the following steps:\n"
steps = [method(:remove_derived_data),
method(:remove_module_cache),
method(:remove_device_support),
method(:remove_old_archives),
method(:remove_expired_provisioning_profiles),
method(:remove_simulator_devices),
method(:remove_doc_sets)]
step_index = 1
steps.each do |method|
method_name = "#{method.name}".gsub('_', ' ').capitalize
puts "#{step_index}: #{method_name}"
step_index += 1
end
puts "\nWhat would you like to do?\n"
puts "[m] 🖐 Run each stap and manually specify what should be removed"
puts "[n] 💥 Nuke'm, remove everything that can be removed"
puts "[1-#{steps.length}] Run a single step"
choice = prompt("(M/N/1-#{steps.length}): ").strip!
if choice.casecmp('M') == 0
puts "Running all steps manually"
run_steps(steps, true)
elsif choice.casecmp('N') == 0
if prompt_bool("Are you sure you would like to Nuke'm?")
run_steps(steps, false)
end
elsif choice.to_i > 0 && choice.to_i <= steps.length
step = steps[choice.to_i - 1]
method_name = "#{step.name}".gsub('_', ' ').capitalize
puts "Running step #{choice.to_i}: #{method_name}"
run_steps([step], true)
end
end
|