Skip to content

Commit

Permalink
Add PARU_CONF
Browse files Browse the repository at this point in the history
Fixes #53
  • Loading branch information
Morganamilo committed Oct 30, 2020
1 parent b3a62bc commit eb9e1b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions man/paru.8
Expand Up @@ -429,12 +429,17 @@ pacman -Qmq | grep -Ee '-(cvs|svn|git|hg|bzr|darcs)$' | paru -S --needed -
pacaur-like devel check.

.SH ENVIRONMENT VARIABLES

.TP
.B AURDEST
Can be set to configure the build directory.

Overridden by \-\-builddir.

.TP
.B PARU_CONF
Overrides where paru will look for its config file.

.SH FILES
.TP
.B CONFIG DIRECTORY
Expand Down
2 changes: 2 additions & 0 deletions man/paru.conf.5
Expand Up @@ -6,6 +6,8 @@
PARU \- AUR Helper

.SH SYNOPSIS
$PARU_CONF
.sp
/etc/paru.conf
.sp
~/.config/paru/paru.conf
Expand Down
4 changes: 3 additions & 1 deletion src/config.rs
Expand Up @@ -257,7 +257,9 @@ impl Config {
..Self::default()
};

if config_path.exists() {
if let Ok(conf) = var("PARU_CONF") {
config.config_path = Some(conf.into());
} else if config_path.exists() {
config.config_path = Some(config_path);
} else {
let config_path = PathBuf::from("/etc/paru.conf");
Expand Down

0 comments on commit eb9e1b1

Please sign in to comment.