From 86cd6208bf02d3ceb06cc9ad88707db7f99a61a1 Mon Sep 17 00:00:00 2001 From: Johannes Rest Date: Thu, 1 Oct 2020 16:22:13 +0200 Subject: [PATCH] Added some more logging to make transparent how we're going to run... --- OneDriveArchiver/Program.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OneDriveArchiver/Program.cs b/OneDriveArchiver/Program.cs index 10f5fd8..8189d6a 100644 --- a/OneDriveArchiver/Program.cs +++ b/OneDriveArchiver/Program.cs @@ -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);