Skip to content

Commit

Permalink
backwards-compatibility for relocated config.txt
Browse files Browse the repository at this point in the history
If the new file doesn’t exist, check for the old path and move it if
necessary.
  • Loading branch information
daisieh committed Jul 26, 2014
1 parent 4d8567e commit cbe5d85
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Configuration.pm
Expand Up @@ -55,6 +55,14 @@ sub get_config_file {
}
$config_file = File::Spec->catfile($atrampath, "config.txt");

# perhaps it is in the old location in lib: move it to here, then carry on.
if (!(-e $config_file)) {
my $oldconfigfile = File::Spec->catfile($atrampath, "lib", "config.txt");
print "moving old config\n";
if (-e $oldconfigfile) {
run_command ("mv", "$oldconfigfile $config_file");
}
}

return $config_file;
}
Expand Down

0 comments on commit cbe5d85

Please sign in to comment.