Skip to content

Commit

Permalink
Merge pull request #103 from openflighthpc/dev/list-format
Browse files Browse the repository at this point in the history
Dev/list format
  • Loading branch information
DavidMarchant authored Mar 19, 2019
2 parents 18683d3 + ef5c5ef commit ef6ec91
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/inventoryware/commands/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ module Inventoryware
module Commands
class List < Command
def run
#TODO format this to have as many results fit on one line as poss.
#puts files.join(" ")
files = Dir.glob(File.join(Config.yaml_dir, '*.yaml')).map! do |file|
File.basename(file, '.yaml')
end
files.each_slice(3).each { |grp| puts grp.join(" ") }
unless files.empty?
puts files.sort
else
puts "No asset files found within #{File.expand_path(Config.yaml_dir)}"
end
end
end
end
Expand Down

0 comments on commit ef6ec91

Please sign in to comment.