mirror of
https://codeberg.org/puppe/mpbackup.git
synced 2025-12-20 05:52:18 +01:00
Improve text output for users
This commit is contained in:
parent
6388495fc7
commit
ee2e4d7129
1 changed files with 7 additions and 4 deletions
5
mpbackup
5
mpbackup
|
|
@ -34,6 +34,7 @@ if !Pathname.new(config_file).exist? then
|
||||||
end
|
end
|
||||||
|
|
||||||
def do_backup(config)
|
def do_backup(config)
|
||||||
|
puts "Applying configuration ‘#{config['name']}’ …"
|
||||||
ENV['RESTIC_REPOSITORY'] = config['repository']
|
ENV['RESTIC_REPOSITORY'] = config['repository']
|
||||||
ENV['RESTIC_PASSWORD'] = STDIN.getpass('Please put in your restic password: ')
|
ENV['RESTIC_PASSWORD'] = STDIN.getpass('Please put in your restic password: ')
|
||||||
|
|
||||||
|
|
@ -75,9 +76,11 @@ def do_backup(config)
|
||||||
ENV.delete('RESTIC_PASSWORD')
|
ENV.delete('RESTIC_PASSWORD')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
puts "Using config file #{config_file} …"
|
||||||
configs = YAML.load_stream(File.open(config_file))
|
configs = YAML.load_stream(File.open(config_file))
|
||||||
if ARGV.empty?
|
if ARGV.empty?
|
||||||
puts "No configuration name has been given. Using the first configuration."
|
puts "No configuration name has been given. Will use the first "\
|
||||||
|
"configuration from the file (‘#{configs.dig(0, 'name')}’)."
|
||||||
do_backup(configs[0])
|
do_backup(configs[0])
|
||||||
else
|
else
|
||||||
ARGV.each do |config_name|
|
ARGV.each do |config_name|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue