Class: Nauvisian::CLI::Commands::Mod::Disable
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Nauvisian::CLI::Commands::Mod::Disable
- Includes:
- MessageHelper
- Defined in:
- lib/nauvisian/cli/commands/mod/disable.rb
Instance Method Summary collapse
Instance Method Details
#call(mod:, **options) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/nauvisian/cli/commands/mod/disable.rb', line 17 def call(mod:, **) mod_directory = Pathname([:mod_directory]) mod_list_path = mod_directory / "mod-list.json" list = Nauvisian::ModList.load(mod_list_path) mod = Nauvisian::Mod[name: mod] list.disable(mod) list.save(mod_list_path) rescue Nauvisian::ModNotFound "❌ You can't disable a MOD which is not in the MOD list (#{mod.name})" exit 1 end |