diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/BorgRestore.pm | 3 | ||||
-rw-r--r-- | lib/App/BorgRestore/Settings.pm | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm index 218be49..90b7d61 100644 --- a/lib/App/BorgRestore.pm +++ b/lib/App/BorgRestore.pm @@ -83,8 +83,7 @@ sub new { my $self = {}; bless $self, $class; - my $db_path = App::BorgRestore::Settings::get_cache_path('archives.db'); - # TODO: make db_path configurable, probably settings too + my $db_path = App::BorgRestore::Settings::get_db_path(); $self->{borg} = $deps->{borg} // App::BorgRestore::Borg->new(); $self->{db} = $deps->{db} // App::BorgRestore::DB->new($db_path); diff --git a/lib/App/BorgRestore/Settings.pm b/lib/App/BorgRestore/Settings.pm index 93312b8..f793b8f 100644 --- a/lib/App/BorgRestore/Settings.pm +++ b/lib/App/BorgRestore/Settings.pm @@ -42,6 +42,10 @@ sub get_cache_path { return get_cache_dir()."/$item"; } +sub get_db_path { + return get_cache_path('archives.db'); +} + 1; |