Using environment variable DUP_DIR to point us to the location of the yml files.

This commit is contained in:
Fabian Schlenz 2017-02-13 16:39:10 +01:00
parent ba4f1e057a
commit 12c16cf9c3

9
dup.rb
View File

@ -185,7 +185,14 @@ if container==nil || container==""
raise "No container given."
end
file = "%s/%s.yml" % [ "/data/fabian/projects/dup", container ]
if ENV['DUP_DIR']
base_dir = ENV['DUP_DIR']
else
base_dir = File.join(Dir.home, ".dup")
puts "Environment variable DUP_DIR is not set. Looking for .yml files in #{base_dir}"
end
file = "%s/%s.yml" % [ base_dir, container ]
if action == :create
action_create(container, file)