Method: ModuleSync.reset

Defined in:
lib/modulesync.rb

.reset(cli_options) ⇒ Object



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/modulesync.rb', line 247

def self.reset(cli_options)
  @options = config_defaults.merge(cli_options)
  if @options[:branch].nil?
    raise Thor::Error,
          "Error: 'branch' option is missing, please set it in configuration or in command line."
  end

  managed_modules.each do |puppet_module|
    puppet_module.repository.reset_workspace(
      branch: @options[:branch],
      source_branch: @options[:source_branch],
      operate_offline: @options[:offline],
    )
  end
end