Added some more logging to make transparent how we're going to run...
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user