Class: VivlioStarter::CLI::SamovarCommands::IndexExportCommand

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

Overview

index:export コマンド - 用語集[g]・棄却語 を持ち運び用ファイルへ書き出す

Constant Summary

Constants included from OptionTokenNormalizer

OptionTokenNormalizer::BARE_VALUE_DEFAULTS

Instance Method Summary collapse

Methods included from OptionTokenNormalizer

#initialize, prepended

Instance Method Details

#callObject



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/vivlio_starter/cli/samovar/index_command.rb', line 201

def call
  return print_usage if options[:help]

  guard_failure = Guards.precheck(Guards::ProjectRootCheck.new)
  return guard_failure if guard_failure

  path = IndexCommands::IndexLibrary.resolve_path((args || []).first)
  Common.log_info("書き出し先: #{path}")
  IndexCommands::IndexLibrary.new.export!(path)
  0
rescue SystemExit => e
  raise e
rescue StandardError => e
  Common.log_error("index:export 実行中にエラー: #{e.message}")
  1
end