Add puppet/archive module
[mirror/dsa-puppet.git] / 3rdparty / modules / archive / lib / facter / archive_windir.rb
diff --git a/3rdparty/modules/archive/lib/facter/archive_windir.rb b/3rdparty/modules/archive/lib/facter/archive_windir.rb
new file mode 100644 (file)
index 0000000..c1baee5
--- /dev/null
@@ -0,0 +1,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