lib/aws/cfn/compiler/mixins/load.rb in aws-cfn-compiler-0.9.4 vs lib/aws/cfn/compiler/mixins/load.rb in aws-cfn-compiler-0.9.5
- old
+ new
@@ -89,10 +89,14 @@
end
if File.directory?(path) and candidates.size > 0
break
end
end
+ unless path
+ @logger.error " !! error: Cannot calculate brick dirname in #{dir} for #{rsrc} with brick path: \n\t#{@config[:brick_path_list].join("\n\t")} \n"
+ abort!
+ end
patn = path
unless @config[:expandedpaths]
patn = short_path(path,3)
end
@@ -102,11 +106,15 @@
end
path
end
def short_path(path,n=2)
- patn = path.split(File::SEPARATOR)[0-n..-1]
- patn = patn.join(File::SEPARATOR)
+ if path
+ patn = path.split(File::SEPARATOR)[0-n..-1]
+ patn = patn.join(File::SEPARATOR)
+ else
+ path
+ end
end
end
end
end
end