Skip to content

Commit e2442f6

Browse files
authored
Merge pull request #1125 from GabrielNagy/PUP-10653/remove-win32-dir-dependency
(PUP-10653) Remove win32/dir constant usage
2 parents dd0d71d + 2ed74a3 commit e2442f6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/facter/facter_dot_d.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,8 @@ def create
207207

208208
# Windows has a different configuration directory that defaults to a vendor
209209
# specific sub directory of the %COMMON_APPDATA% directory.
210-
if Dir.const_defined? 'COMMON_APPDATA' # rubocop:disable Metrics/BlockNesting : Any attempt to alter this breaks it
211-
windows_facts_dot_d = File.join(Dir::COMMON_APPDATA, 'PuppetLabs', 'facter', 'facts.d')
212-
Facter::Util::DotD.new(windows_facts_dot_d).create
213-
end
210+
windows_facts_dot_d = File.join(ENV['ALLUSERSPROFILE'], 'PuppetLabs', 'facter', 'facts.d')
211+
Facter::Util::DotD.new(windows_facts_dot_d).create
214212
end
215213
end
216214
end

0 commit comments

Comments
 (0)