Class: Vivlio::Starter::CLI::SamovarCommands::IndexBuildCommand

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/vivlio/starter/cli/samovar/index_command.rb

Overview

index:build コマンド - 索引ページを生成(内部用)利用者には非公開だが、デバッグ用に残す

Instance Method Summary collapse

Instance Method Details

#callObject



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/vivlio/starter/cli/samovar/index_command.rb', line 134

def call
  return print_usage if options[:help]

  ENV['VERBOSE'] = '1' if options[:verbose]
  chapters = IndexCommands.resolve_chapters(files || [])

  manager = UnifiedIndexManager.new
  manager.build_index!(chapters)
  0
rescue SystemExit => e
  raise e
rescue StandardError => e
  Common.log_error("index:build 実行中にエラー: #{e.message}")
  Common.log_error(e.backtrace.first(5).join("\n")) if ENV['VERBOSE']
  1
end