Class: ModuleSync::CLI::Base

Inherits:
Thor
  • Object
show all
Includes:
ModuleSync::Constants
Defined in:
lib/modulesync/cli.rb

Constant Summary

Constants included from ModuleSync::Constants

ModuleSync::Constants::CONF_FILE, ModuleSync::Constants::GLOBAL_DEFAULTS_KEY, ModuleSync::Constants::HOOK_FILE, ModuleSync::Constants::MODULESYNC_CONF_FILE, ModuleSync::Constants::MODULE_CONF_FILE, ModuleSync::Constants::MODULE_FILES_DIR

Instance Method Summary collapse

Instance Method Details

#updateObject

Raises:

  • (Thor::Error)

49
50
51
52
53
54
55
56
# File 'lib/modulesync/cli.rb', line 49

def update
  config = { :command => 'update' }.merge(options)
  config.merge!(Util.parse_config(MODULESYNC_CONF_FILE))
  config = Util.symbolize_keys(config)
  raise Thor::Error, 'No value provided for required option "--message"' unless config[:noop] || config[:message] || config[:offline]
  config[:git_opts] = { 'amend' => config[:amend], 'force' => config[:force] }
  ModuleSync.update(config)
end