mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
bugfix: fix path prefix in folder resolution
This commit is contained in:
parent
73b7b3c99a
commit
8f0c9c890e
2 changed files with 3 additions and 3 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
module Vulcano::Targets
|
||||
module DirsHelper
|
||||
class ChefAuditDir
|
||||
class ProfileDir
|
||||
def handles?(paths)
|
||||
paths.include?('recipes') and paths.include?('metadata.rb')
|
||||
end
|
||||
|
@ -39,7 +39,7 @@ module Vulcano::Targets
|
|||
end
|
||||
|
||||
HANDLERS = [
|
||||
ChefAuditDir, ServerspecDir, FlatDir
|
||||
ProfileDir, ServerspecDir, FlatDir
|
||||
].map(&:new)
|
||||
|
||||
def self.get_handler(paths)
|
||||
|
|
|
@ -15,7 +15,7 @@ module Vulcano::Targets
|
|||
# find all files in the folder
|
||||
files = Dir[File.join(target, '**', '*')]
|
||||
# remove the prefix
|
||||
files = files.map { |x| x[target.length + 1..-1] }
|
||||
files = files.map { |x| x.sub(target, '') }
|
||||
# get the dirs helper
|
||||
helper = DirsHelper.get_handler(files)
|
||||
if helper.nil?
|
||||
|
|
Loading…
Reference in a new issue