summaryrefslogtreecommitdiff
path: root/lib/chef/knife/core/object_loader.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/knife/core/object_loader.rb')
-rw-r--r--lib/chef/knife/core/object_loader.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/chef/knife/core/object_loader.rb b/lib/chef/knife/core/object_loader.rb
index de683b23fd..4ba41c53c3 100644
--- a/lib/chef/knife/core/object_loader.rb
+++ b/lib/chef/knife/core/object_loader.rb
@@ -71,13 +71,13 @@ class Chef
def find_all_objects(path)
path = File.join(path, '*')
path << '.{json,rb}'
- objects = Dir.glob(File.expand_path(path))
+ objects = Dir.glob(Chef::Util::PathHelper.escape_glob(File.expand_path(path)))
objects.map { |o| File.basename(o) }
end
def find_all_object_dirs(path)
path = File.join(path, '*')
- objects = Dir.glob(File.expand_path(path))
+ objects = Dir.glob(Chef::Util::PathHelper.escape_glob(File.expand_path(path)))
objects.delete_if { |o| !File.directory?(o) }
objects.map { |o| File.basename(o) }
end
@@ -111,4 +111,3 @@ class Chef
end
end
end
-