Skip to content

Commit

Permalink
Changed the default download location of sources from ~/.config to ~/…
Browse files Browse the repository at this point in the history
….cache

Closes: #249
  • Loading branch information
trizen committed May 21, 2022
1 parent 46a7136 commit b6530cc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion trizen
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ my $home_dir = $ENV{HOME} || $ENV{LOGDIR} || (getpwuid $<)[7] || `echo -n ~`;
# Configuration directory
my $config_dir = catdir($ENV{XDG_CONFIG_HOME} || catdir($home_dir, '.config'), $execname);

# Cache directory
my $cache_dir = catdir($ENV{XDG_CACHE_HOME} || catdir($home_dir, '.cache'), $execname);

# Configuration file
my $config_file = catfile($config_dir, "$execname.conf");

Expand Down Expand Up @@ -195,7 +198,12 @@ my %CONFIG = (
syntax_highlighting_cmd => '/usr/bin/highlight -O ansi',
);

$CONFIG{clone_dir} = catdir($config_dir, 'sources');
$CONFIG{clone_dir} = catdir($cache_dir, 'sources');

if (not -d $CONFIG{clone_dir}) {
make_path($CONFIG{clone_dir})
or note(":: Unable to create directory <<$CONFIG{clone_dir}>>: {!$!!}");
}

my %lconfig = (
%CONFIG,
Expand Down

0 comments on commit b6530cc

Please sign in to comment.