diff --git a/NDecrypt/Program.cs b/NDecrypt/Program.cs index 0803964..88cb990 100644 --- a/NDecrypt/Program.cs +++ b/NDecrypt/Program.cs @@ -114,7 +114,9 @@ namespace NDecrypt if (tool == null) continue; - ProcessPath(args[i], tool, encrypt, force, outputHashes); + Console.WriteLine(args[i]); + ProcessPath(args[i], tool, encrypt, force); + if (outputHashes) WriteHashes(args[i]); } else if (Directory.Exists(args[i])) { @@ -124,7 +126,9 @@ namespace NDecrypt if (tool == null) continue; - ProcessPath(file, tool, encrypt, force, outputHashes); + Console.WriteLine(file); + ProcessPath(file, tool, encrypt, force); + if (outputHashes) WriteHashes(file); } } else @@ -141,28 +145,12 @@ namespace NDecrypt /// Processing tool to use on the file path /// Indicates if the file should be encrypted or decrypted /// Indicates if the operation should be forced - /// True to write out a hashfile, false otherwise - private static void ProcessPath(string path, - ITool tool, - bool encrypt, - bool force, - bool outputHashes) + private static void ProcessPath(string path, ITool tool, bool encrypt, bool force) { - Console.WriteLine(path); - if (encrypt && !tool.EncryptFile(path, force)) - { Console.WriteLine("Encryption failed!"); - return; - } else if (!encrypt && !tool.DecryptFile(path, force)) - { Console.WriteLine("Decryption failed!"); - return; - } - - if (outputHashes) - WriteHashes(path); } ///