File: single_config_dir

package info (click to toggle)
libfindbin-libs-perl 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 408 kB
  • sloc: perl: 787; makefile: 7
file content (17 lines) | stat: -rw-r--r-- 578 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/env perl
########################################################################
# locate the first "etc' dir looking up the tree, store its path into
# $conf_dir.
#
# Note that if ./t/etc exists this can be used to put test-specific 
# config files in ./t, keeping them separate from "real" configs.
########################################################################

use File::Basename;

use FindBin::libs   qw( base=etc export=conf_dir scalar );

my $base    = basename $0;
my $path    = "$conf_dir/$base.conf";

-e $path or die "Missing config file: '$path'";