Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag to msync execute on the default branch #288

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/modulesync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ def self.execute(cli_options)
$stdout.puts "#{puppet_module.given_name}:"

puppet_module.repository.clone unless puppet_module.repository.cloned?
puppet_module.repository.switch branch: @options[:branch]
if @options[:default_branch]
puppet_module.repository.switch branch: false
else
puppet_module.repository.switch branch: @options[:branch]
end

command_args = cli_options[:command_args]
local_script = File.expand_path command_args[0]
Expand Down
5 changes: 5 additions & 0 deletions lib/modulesync/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ def update
aliases: '-b',
desc: 'Branch name to make the changes in.',
default: CLI.defaults[:branch]
option :default_branch,
aliases: '-B',
type: :boolean,
desc: 'Work on the default branch (take precedence over --branch).',
default: false
option :fail_fast,
type: :boolean,
desc: 'Abort the run after a command execution failure',
Expand Down