From 12c16cf9c325695cb8785285d0de42d5bc2f9e96 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Mon, 13 Feb 2017 16:39:10 +0100 Subject: [PATCH] Using environment variable DUP_DIR to point us to the location of the yml files. --- dup.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dup.rb b/dup.rb index 971511d..0cad562 100755 --- a/dup.rb +++ b/dup.rb @@ -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)