class MiGA::Cli::Action::TaxDist

def get_tab_index(dir)

def get_tab_index(dir)
  if cli[:index].nil?
    ds = cli.load_and_filter_datasets
    ds.keep_if { |d| !d.metadata[:tax].nil? }
    cli.say 'Indexing taxonomy'
    tax_index = TaxIndex.new
    ds.each { |d| tax_index << d }
    tab = File.expand_path('index.tab', dir)
    File.open(tab, 'w') { |fh| fh.print tax_index.to_tab }
  else
    tab = cli[:index]
  end
  tab
end