Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLERD_HOME could be an environment variable #49

Open
taskboy3000 opened this issue Jun 16, 2020 · 0 comments
Open

PLERD_HOME could be an environment variable #49

taskboy3000 opened this issue Jun 16, 2020 · 0 comments

Comments

@taskboy3000
Copy link
Collaborator

taskboy3000 commented Jun 16, 2020

Inspired from Perl, Java, et al, plerd could have a notion of a home directory which it can at least find the conf file. That way, the following "just works":

$ plerdall --init (accept defaults)
$ export PLERD_HOME=$HOME/plerd
$ plerdall # any action

This can be implemented like:

if (!defined $config_file && exists $ENV{PLERD_HOME}) {
$config_file = "$ENV{PLERD_HOME}/conf/plerd.conf";
}

Given that maybe only the config file lives there, the better option might be to have the default config file be $HOME/.plerd.conf?

That implementation is slicker:

if (!defined $config_file && -e "$ENV{HOME}/.plerd.conf") {
$config_file = "$ENV{HOME}/.plerd.conf";
}

Something to ponder.

Whatever you decide, after a user runs plerdall, I would suggest that plerdall should just work if all defaults were accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant