Added some more logging to make transparent how we're going to run...

This commit is contained in:
2020-10-01 16:22:13 +02:00
parent b1ea579605
commit 86cd6208bf

View File

@@ -37,6 +37,7 @@ namespace OneDriveArchiver
// normal processing...
Console.WriteLine($"{appName}: starting up...");
// default is not using the recursive mode...
var needsRecursion = false;
// set target path
@@ -46,11 +47,15 @@ namespace OneDriveArchiver
// check if source directory is equal to target. In that case
// we do not need any recursion at all
var sourcePath = Path.GetFullPath(args[0]);
if (sourcePath != targetPath)
{
Console.WriteLine("Detected path to be different from backup path. So using recursion.");
needsRecursion = true;
}
else
{
Console.WriteLine("Detected that we're running in parent directory of back folders. Skipping recursion to prevent damage from backups.");
}
// process the base directory, plus possible containing directories recursively
IoHelper.ProcessFilesForDirectory(args[0], appName, targetPath, needsRecursion);