[Bps-public-commit] r16547 - in sd/trunk: .
spang at bestpractical.com
spang at bestpractical.com
Sun Oct 26 17:09:22 EDT 2008
Author: spang
Date: Sun Oct 26 17:09:15 2008
New Revision: 16547
Modified:
sd/trunk/ (props changed)
sd/trunk/lib/App/SD/Config.pm
Log:
r50906 at loki: spang | 2008-10-26 13:07:35 -0400
doc config order of precedence
Modified: sd/trunk/lib/App/SD/Config.pm
==============================================================================
--- sd/trunk/lib/App/SD/Config.pm (original)
+++ sd/trunk/lib/App/SD/Config.pm Sun Oct 26 17:09:15 2008
@@ -11,6 +11,10 @@
before 'app_config_file' => sub {
my $self = shift;
+ # The order of preference for config files is:
+ # $ENV{SD_CONFIG} > fs_root/sdrc > fs_root/prophetrc (for backcompat)
+ # $HOME/.sdrc > $ENV{PROPHET_APP_CONFIG} > $HOME/.prophetrc
+
$ENV{'PROPHET_APP_CONFIG'} = $self->file_if_exists($ENV{'SD_CONFIG'})
|| $self->file_if_exists(
File::Spec->catfile($self->app_handle->handle->fs_root => 'sdrc'))
@@ -18,7 +22,8 @@
# backcompat
File::Spec->catfile($self->app_handle->handle->fs_root => 'prophetrc'))
|| $self->file_if_exists(
- File::Spec->catfile($ENV{'HOME'}.'/.sdrc'));
+ File::Spec->catfile($ENV{'HOME'}.'/.sdrc'))
+ || $ENV{'PROPHET_APP_CONFIG'}; # don't overwrite with nothing
};
__PACKAGE__->meta->make_immutable;
More information about the Bps-public-commit
mailing list