From 3fbc7d861d1f95513151010cd0f2d620befc2870 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 18 Dec 2013 03:11:30 -0500 Subject: [PATCH] Allow a global /etc/htsnrc to override the user's ~/.htsnrc. --- doc/htsnrc.example | 3 ++- src/OptionalConfiguration.hs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/htsnrc.example b/doc/htsnrc.example index 18a5a3b..ed47402 100644 --- a/doc/htsnrc.example +++ b/doc/htsnrc.example @@ -1,5 +1,6 @@ # Example configuration file for htsn. For this to take effect, you -# would need to place it in $HOME/.htsnrc +# would need to place it in either /etc/htsnrc or $HOME/.htsnrc. The +# latter overrides the former. # The username used to connect to the feed. # diff --git a/src/OptionalConfiguration.hs b/src/OptionalConfiguration.hs index 7ed63c5..ea7a678 100644 --- a/src/OptionalConfiguration.hs +++ b/src/OptionalConfiguration.hs @@ -69,7 +69,8 @@ instance Monoid OptionalConfiguration where from_rc :: IO OptionalConfiguration from_rc = do - cfg <- DC.load [ DC.Optional "$(HOME)/.htsnrc" ] + cfg <- DC.load [ DC.Optional "/etc/htsnrc", + DC.Optional "$(HOME)/.htsnrc" ] cfg_password <- DC.lookup cfg "password" cfg_output_directory <- DC.lookup cfg "output_directory" cfg_username <- DC.lookup cfg "username" -- 2.44.2