Skip to content

Commit 170233f

Browse files
author
Kevin Paulisse
committed
Change .file? to .exist? to avoid failing if it points at a directory
1 parent 7857f7f commit 170233f

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/octocatalog-diff/catalog-util/fileresources.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def self.file_path(src, modulepaths)
3636
path = File.join(Regexp.last_match(1), 'files', Regexp.last_match(2))
3737
modulepaths.each do |mp|
3838
file = File.join(mp, path)
39-
return file if File.file?(file)
39+
return file if File.exist?(file)
4040
end
4141

4242
nil
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Hi

spec/octocatalog-diff/fixtures/repos/modulepath/modules/modulestest/manifests/init.pp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
file { '/tmp/modulestest':
33
source => 'puppet:///modules/modulestest/tmp/modulestest',
44
}
5+
6+
file { '/tmp/foobaz':
7+
ensure => directory,
8+
source => 'puppet:///modules/modulestest/foo',
9+
recurse => true,
10+
}
511
}

0 commit comments

Comments
 (0)