Sha256: a736138ebfd10b693e0a334034c9d380665699933282e0ec9d3561320b1f26b4
Contents?: true
Size: 815 Bytes
Versions: 8
Compression:
Stored size: 815 Bytes
Contents
module Kosmos module PostProcessors class ModuleManagerResolver def self.post_process(ksp_path) game_data = File.join(ksp_path, 'GameData') module_managers = Dir[File.join(game_data, '*')].select do |file| File.basename(file).start_with?('ModuleManager') end most_recent_manager = module_managers.max_by do |file| # Converts a string like this: # # ModuleManager.5.2.3 # # Into this: # # [5, 2, 3] File.basename(file).scan(/\d+/).map(&:to_i) end (module_managers - [most_recent_manager]).each do |file| Util.log "Detected and deleting outdated version of ModuleManager: #{file}" File.delete(file) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems