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

exec command: Only switch branch when cloning #251

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions lib/modulesync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,12 @@ def self.execute(cli_options)
managed_modules.each do |puppet_module|
$stdout.puts "#{puppet_module.given_name}:"

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

command_args = cli_options[:command_args]
local_script = File.expand_path command_args[0]
Expand Down