Skip to content

Commit b973772

Browse files
committed
Don't setup directory structure if in a control repo
1 parent 80820b6 commit b973772

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/rspec-puppet/setup.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ def self.run(module_name=nil)
2020
end
2121

2222
def self.safe_setup_directories(module_name=nil, verbose=true)
23+
if control_repo?
24+
$stderr.puts "Unable to setup rspec-puppet automatically in a control repo" if verbose
25+
return false
26+
end
27+
2328
if module_name.nil?
2429
module_name = get_module_name
2530
if module_name.nil?
26-
$stderr.puts "Unable to determine module name. Aborting"
31+
$stderr.puts "Unable to determine module name. Aborting" if verbose
2732
return false
2833
end
2934
end
@@ -58,6 +63,10 @@ def self.safe_teardown_links(module_name=nil)
5863
end
5964
end
6065
protected
66+
def self.control_repo?
67+
!File.exist?('metadata.json')
68+
end
69+
6170
def self.get_module_name
6271
module_name = nil
6372
Dir["manifests/*.pp"].entries.each do |manifest|

0 commit comments

Comments
 (0)