File: root_home.rb

package info (click to toggle)
puppet-module-puppetlabs-stdlib 9.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,448 kB
  • sloc: ruby: 3,522; sh: 46; makefile: 2
file content (11 lines) | stat: -rw-r--r-- 196 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

Facter.add(:root_home) do
  setcode do
    require 'etc'
  rescue LoadError
  # Unavailable on platforms like Windows
  else
    Etc.getpwnam('root')&.dir
  end
end