Class: XCCache::Command::Cache::List

Inherits:
XCCache::Command::Cache show all
Defined in:
lib/xccache/command/cache/list.rb

Instance Attribute Summary

Attributes inherited from XCCache::Command

#build_options, #install_options

Instance Method Summary collapse

Methods inherited from XCCache::Command

#initialize, #str_to_sdks

Methods included from XCCache::Config::Mixin

#config

Constructor Details

This class inherits a constructor from XCCache::Command

Instance Method Details

#runObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/xccache/command/cache/list.rb', line 7

def run
  target_paths = config.spm_cache_dir.glob("*")
  target_paths.each do |target_path|
    next if (paths = target_path.glob("*")).empty?
    descs = paths.map { |p| "  #{p.basename.to_s.green}" }
    UI.info <<~DESC
      #{target_path.basename.to_s.cyan}:
      #{descs.join('\n')}
    DESC
  end
end