diff options
author | Claire McQuin <claire@getchef.com> | 2014-09-19 11:57:50 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-09-22 11:22:29 -0700 |
commit | c3216811254bd98d0e70772ea54a2dc53e9e0b3a (patch) | |
tree | dde4818db9c93f7363578fa022b8993de55bc66f /lib/chef/knife/core/object_loader.rb | |
parent | 1393427cf7e3a871eea314c6e683299e2c48e648 (diff) | |
download | chef-c3216811254bd98d0e70772ea54a2dc53e9e0b3a.tar.gz |
Escape path for globbing.
Diffstat (limited to 'lib/chef/knife/core/object_loader.rb')
-rw-r--r-- | lib/chef/knife/core/object_loader.rb | 5 |
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 - |