Commit f9ba7e62 authored by BobChaos's avatar BobChaos

Allow "folders method" to receive platform arg

Signed-off-by: BobChaos's avatarMarc Chamberland <[email protected]>
parent 30237174
......@@ -75,20 +75,20 @@ module ChefConfig
end
# On *nix, /etc/chef
def self.etc_chef_dir
path = ChefUtils.windows? ? c_chef_dir : PathHelper.join("/etc", ChefConfig::Dist::DIR_SUFFIX)
def self.etc_chef_dir(is_windows = ChefUtils.windows?)
path = is_windows? ? c_chef_dir : PathHelper.join("/etc", ChefConfig::Dist::DIR_SUFFIX)
PathHelper.cleanpath(path)
end
# On *nix, /var/chef
def self.var_chef_dir
path = ChefUtils.windows? ? c_chef_dir : PathHelper.join("/var", ChefConfig::Dist::DIR_SUFFIX)
def self.var_chef_dir(is_windows = ChefUtils.windows?)
path = is_windows? ? c_chef_dir : PathHelper.join("/var", ChefConfig::Dist::DIR_SUFFIX)
PathHelper.cleanpath(path)
end
# On *nix, the root of /var/, used to test if we can create and write in /var/chef
def self.var_root_dir
path = ChefUtils.windows? ? c_chef_dir : "/var"
def self.var_root_dir(is_windows = ChefUtils.windows?)
path = is_windows? ? c_chef_dir : "/var"
PathHelper.cleanpath(path)
end
......@@ -99,6 +99,12 @@ module ChefConfig
PathHelper.cleanpath(path)
end
def self.c_opscode_dir
drive = windows_installation_drive || "C:"
path = PathHelper.join(drive, ChefConfig::Dist::LEGACY_CONF_DIR, ChefConfig::Dist::DIR_SUFFIX)
PathHelper.cleanpath(path)
end
# the drive where Chef is installed on a windows host. This is determined
# either by the drive containing the current file or by the SYSTEMDRIVE ENV
# variable
......
......@@ -15,5 +15,9 @@ module ChefConfig
# The user's configuration directory
USER_CONF_DIR = ".chef".freeze
# The legacy conf folder: C:/opscode/chef. Specifically the "opscode" part
# DIR_SUFFIX is appended to it in code where relevant
LEGACY_CONF_DIR = "opscode".freeze
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment