summaryrefslogtreecommitdiff
path: root/chef-config/lib/chef-config/path_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'chef-config/lib/chef-config/path_helper.rb')
-rw-r--r--chef-config/lib/chef-config/path_helper.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/chef-config/lib/chef-config/path_helper.rb b/chef-config/lib/chef-config/path_helper.rb
index b3f44d802a..6b501cb9cb 100644
--- a/chef-config/lib/chef-config/path_helper.rb
+++ b/chef-config/lib/chef-config/path_helper.rb
@@ -139,11 +139,13 @@ module ChefConfig
# using Pathname#cleanpath instead of this function.
def self.cleanpath(path, windows: ChefUtils.windows?)
path = Pathname.new(path).cleanpath.to_s
- # ensure all forward slashes are backslashes
if windows
- path = path.gsub(File::SEPARATOR, path_separator(windows: windows))
+ # ensure all forward slashes are backslashes
+ path.gsub(File::SEPARATOR, path_separator(windows: windows))
+ else
+ # ensure all backslashes are forward slashes
+ path.gsub(BACKSLASH, File::SEPARATOR)
end
- path
end
def self.paths_eql?(path1, path2, windows: ChefUtils.windows?)