Class: Nauvisian::CLI::Commands::Mod::Installed
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Nauvisian::CLI::Commands::Mod::Installed
- Includes:
- MessageHelper
- Defined in:
- lib/nauvisian/cli/commands/mod/installed.rb
Instance Method Summary collapse
Instance Method Details
#call(**options) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/nauvisian/cli/commands/mod/installed.rb', line 17 def call(*, **) mod_directory = Pathname([:mod_directory]) mod_list_path = mod_directory / "mod-list.json" mods = Nauvisian::ModList.load(mod_list_path).sort rows = mods.map {|mod, enabled| {"Name" => mod.name, "Enabled" => enabled} } lister = Nauvisian::CLI::Lister.for([:format].to_sym).new(%w(Name Enabled)) lister.list(rows) rescue => e (e) exit 1 end |