diff options
author | Marc Chamberland <chamberland.marc@gmail.com> | 2020-01-29 21:20:25 -0500 |
---|---|---|
committer | Marc Chamberland <chamberland.marc@gmail.com> | 2020-02-26 19:06:50 -0500 |
commit | a3169e349311f43afa34a5243c6e34b8fc384100 (patch) | |
tree | e3c37fd5d9dabe416adfdc52e718b6c16741a290 | |
parent | 64ddf572b19256c3bf2e480282da5333925a9201 (diff) | |
download | chef-a3169e349311f43afa34a5243c6e34b8fc384100.tar.gz |
Allow "folders method" to receive platform arg
Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com>
-rw-r--r-- | chef-config/lib/chef-config/config.rb | 7 | ||||
-rw-r--r-- | chef-config/lib/chef-config/dist.rb | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb index 6e0da21e51..17ab31ead5 100644 --- a/chef-config/lib/chef-config/config.rb +++ b/chef-config/lib/chef-config/config.rb @@ -75,7 +75,6 @@ module ChefConfig end # On *nix, /etc/chef - 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) @@ -100,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 diff --git a/chef-config/lib/chef-config/dist.rb b/chef-config/lib/chef-config/dist.rb index d46c9c99d6..e75b26730f 100644 --- a/chef-config/lib/chef-config/dist.rb +++ b/chef-config/lib/chef-config/dist.rb @@ -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 |