Class: VivlioStarter::CLI::SamovarCommands::CleanCommand

Inherits:
VsCommand
  • Object
show all
Defined in:
lib/vivlio_starter/cli/samovar/clean_command.rb

Overview

clean コマンドの Samovar 実装

Constant Summary

Constants included from OptionTokenNormalizer

OptionTokenNormalizer::BARE_VALUE_DEFAULTS

Instance Method Summary collapse

Methods included from OptionTokenNormalizer

#initialize, prepended

Instance Method Details

#callObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/vivlio_starter/cli/samovar/clean_command.rb', line 41

def call
  return print_usage if options[:help]

  # 前提条件の検証(precondition-guard-spec.md: clean は ProjectRoot ○)
  guard_failure = Guards.precheck(Guards::RelaxedCheck.new(Guards::ProjectRootCheck.new))
  return guard_failure if guard_failure

  report_result(CleanCommands.execute_clean(options.dup))
  0
rescue SystemExit => e
  raise e
rescue StandardError => e
  VivlioStarter::CLI::Common.log_warn("clean コマンド実行中にエラー: #{e.message}")
  1
end