diff --git a/config.yaml b/config.yaml index 7b98bef..2edbea3 100644 --- a/config.yaml +++ b/config.yaml @@ -54,7 +54,8 @@ } # Target directory for the backup files - # It his is a relative path it will be relative to the script's directory + # If this is a relative path it will be relative to the script's directory + # Absolute path starts with '/' or '~' backup_dir: './output' # Maximum number of messages to backup for each target (0 means unlimited) diff --git a/lib/util.rb b/lib/util.rb index 6c22598..b189fa0 100644 --- a/lib/util.rb +++ b/lib/util.rb @@ -17,7 +17,15 @@ def get_full_name(user) end def get_backup_dir - File.expand_path(File.join('..', '..', $config['backup_dir']), __FILE__) + parent_dir = + case $config['backup_dir'][0] + when '/', '~' + $config['backup_dir'] + else + ['..', '..', $config['backup_dir']] + end + + File.expand_path(File.join(parent_dir), __FILE__) end def get_media_dir(dialog)