File: archive_windir.rb

package info (click to toggle)
puppet-module-puppet-archive 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 688 kB
  • sloc: ruby: 2,152; sh: 30; makefile: 2
file content (11 lines) | stat: -rw-r--r-- 286 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
Facter.add(:archive_windir) do
  confine :osfamily => :windows # rubocop:disable Style/HashSyntax
  setcode do
    program_data = `echo %SYSTEMDRIVE%\\ProgramData`.chomp
    if File.directory? program_data
      "#{program_data}\\staging"
    else
      'C:\\staging'
    end
  end
end