Add option for fallback yay cache directory.

This commit is contained in:
Nicolás A. Ortega Froysa 2024-05-27 13:58:07 +02:00
parent c78f9a36d9
commit 3eb87b5907

View File

@ -195,7 +195,11 @@ sub find_local_pkg($pkgmgr, $pkg_name, $pkg_ver='') {
my $aur_dir; my $aur_dir;
if ($pkgmgr->{name} eq 'yay') { if ($pkgmgr->{name} eq 'yay') {
if ($ENV{'XDG_CACHE_HOME'} ne '') {
$aur_dir = "$ENV{'XDG_CACHE_HOME'}/yay/$pkg_name"; $aur_dir = "$ENV{'XDG_CACHE_HOME'}/yay/$pkg_name";
} else {
$aur_dir = "$ENV{'HOME'}/.cache/yay/$pkg_name";
}
} else { } else {
return ''; return '';
} }