Skip to content
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
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.0
TargetRubyVersion: 2.4
Exclude:
- 'vendor/**/*'
- 'tmp/**/*'
Expand All @@ -25,3 +25,6 @@ Layout/IndentHeredoc:
# sane line length
Metrics/LineLength:
Max: 120

Style/FrozenStringLiteralComment:
Enabled: false
21 changes: 11 additions & 10 deletions features/step_definitions/git_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
- puppet-test
"""
)
write_file('modulesync.yml', <<-CONFIG)
---
namespace: sources
git_base: file://#{expand_path('.')}/
CONFIG
write_file('modulesync.yml', <<~CONFIG)
---
namespace: sources
git_base: file://#{expand_path('.')}/
CONFIG
end

Given Regexp.new(/a remote module repository with "(.+?)" as the default branch/) do |branch|
Expand All @@ -33,11 +33,12 @@
- puppet-test
"""
)
write_file('modulesync.yml', <<-CONFIG)
---
namespace: sources
git_base: file://#{expand_path('.')}/
CONFIG
write_file('modulesync.yml', <<~CONFIG)
---
namespace: sources
git_base: file://#{expand_path('.')}/
CONFIG

cd('sources/puppet-test') do
steps %(
And I run `git branch -M master #{branch}`
Expand Down
5 changes: 2 additions & 3 deletions lib/modulesync/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ def deactivate
class Base < Thor
class_option :project_root,
:aliases => '-c',
:desc => 'Path used by git to clone modules into. Defaults to "modules"',
:desc => 'Path used by git to clone modules into.',
:default => CLI.defaults[:project_root] || 'modules'
class_option :git_base,
:desc => 'Specify the base part of a git URL to pull from',
:default => CLI.defaults[:git_base] || 'git@github.com:'
class_option :namespace,
:aliases => '-n',
:desc => 'Remote github namespace (user or organization) to clone from and push to.' \
' Defaults to puppetlabs',
:desc => 'Remote github namespace (user or organization) to clone from and push to.',
:default => CLI.defaults[:namespace] || 'puppetlabs'
class_option :filter,
:aliases => '-f',
Expand Down
2 changes: 1 addition & 1 deletion lib/modulesync/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def self.update(name, files, options)
tag(repo, new, options[:tag_pattern]) if options[:tag]
end
rescue ::Git::GitExecuteError => git_error
if git_error.message =~ /working (directory|tree) clean/
if git_error.message.match?(/working (directory|tree) clean/)
puts "There were no files to update in #{name}. Not committing."
return false
else
Expand Down