Commit e9ccb282 authored by Efthymia Bika's avatar Efthymia Bika
Browse files

Create restore dir only if it doesn't exist

parent d171125b
......@@ -128,8 +128,16 @@ function run_duplicity(restore, force) {
if(restore) {
if(file_to_restore) {
directory = path.join($("#res-directory").html(), file_to_restore);
mkdirp(directory, function(err) {
if(err) console.error(err);
fs.stat(directory, function (err, stats) {
if(err) {
mkdirp.sync(directory, function(err) {
if(err) {
console.error(err);
$("#msg").html(err);
$("#msg").addClass("panel");
}
});
}
});
} else {
directory = $("#res-directory").html();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment