Skip to content
This repository has been archived by the owner on Jun 28, 2018. It is now read-only.

Ensure GEM_PATH does not use \ on windows #424

Merged
merged 2 commits into from
Jul 2, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions files/rubygems-customization/windows/operating_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@ module Gem

def self.user_dir
chefdk_home_set = !([nil, ''].include? ENV['CHEFDK_HOME'])
default_home = if RUBY_PLATFORM =~ /mswin|mingw|windows/
File.join(ENV['LOCALAPPDATA'], 'chefdk')
else
File.join(Gem.user_home, '.chefdk')
end
# We call expand_path here because it converts \ -> /
# Rubygems seems to require that we not use \
default_home = File.join(File.expand_path(ENV['LOCALAPPDATA']), 'chefdk')

chefdk_home = if chefdk_home_set
ENV['CHEFDK_HOME']
else
old_home = File.join(Gem.user_home, '.chefdk')
if RUBY_PLATFORM =~ /mswin|mingw|windows/ && File.exists?(old_home)
if File.exists?(old_home)
Gem.ui.say <<-EOF
Warning:
ChefDK now defaults to using #{default_home} instead of #{old_home}.
Expand Down