From 4f175a22cf726bfa09652d8d9ca6374785561348 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 17 Jun 2016 17:33:32 -0400 Subject: allow overriding the yamldir from the environment --- README.md | 4 +++- scripts/common.rb.in | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ef3371b..132a7da 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,9 @@ configuration). The main two things programs at are `yamldir` which tells them where to find `hackers.git/users`, and `groupgroups` which augments the -`groups` array for each user. +`groups` array for each user. You may override the setting for +`yamldir` by setting the environment variable +`PARABOLA_HACKERS_YAMLDIR` ## pacman-make-keyring diff --git a/scripts/common.rb.in b/scripts/common.rb.in index d81fa0c..7c457b8 100644 --- a/scripts/common.rb.in +++ b/scripts/common.rb.in @@ -17,7 +17,13 @@ require 'yaml' def cfg - @cfg ||= YAML::load(open("@conf_file@")) + if @cfg.nil? + @cfg = YAML::load(open("@conf_file@")) + if ENV['PARABOLA_HACKERS_YAMLDIR'] + @cfg["yamldir"] = ENV['PARABOLA_HACKERS_YAMLDIR'] + end + end + return @cfg end def load_user_yaml(filename) -- cgit v1.2.2