Skip to content

Commit

Permalink
CLI: Add reset-hard option to "update" command
Browse files Browse the repository at this point in the history
  • Loading branch information
neomilium committed Dec 16, 2020
1 parent d9b8c93 commit a55759e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/modulesync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def self.manage_module(puppet_module, module_files, module_options, defaults, op
Git.pull(options[:git_base], git_repo, options[:branch], options[:project_root], module_options || {})
end

repo.reset_hard(options[:reset_hard]) if options[:reset_hard]

module_configs = Util.parse_config(module_file(options[:project_root], namespace, module_name, MODULE_CONF_FILE))
settings = Settings.new(defaults[GLOBAL_DEFAULTS_KEY] || {},
defaults,
Expand Down
2 changes: 2 additions & 0 deletions lib/modulesync/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class Base < Thor # rubocop:disable Metrics/ClassLength
:type => :boolean,
:desc => 'Force push amended commit',
:default => false
option :reset_hard,
:desc => 'Hard-reset on specified branch (e.g. origin/master) before updating modules'
option :noop,
:type => :boolean,
:desc => 'No-op mode',
Expand Down

0 comments on commit a55759e

Please sign in to comment.