diff --git a/Program.cs b/Program.cs index 983ccf6..4f04ee1 100644 --- a/Program.cs +++ b/Program.cs @@ -94,25 +94,34 @@ class Program Environment.Exit(1); } - List Input_files = GetAllFiles(_inputDirectory); - Log.Information("Input File Count: {count}",Input_files.Count()); - foreach (string item in Input_files) - { - Console.WriteLine(item); - } - - List MatchFiles = GetAllFilesMatching(".*r.*",_inputDirectory); - - Log.Information("MatchFiles '.*r.*' File Count: {count}",MatchFiles.Count()); - foreach (string item in MatchFiles) - { - Console.WriteLine(item); - } - + // Test for dependencies List deps = new List{"pandoc"}; - var dep2 = CheckDeps(deps); - Log.Debug("CheckDeps result: {@dep}",dep2); + var dep = CheckDeps(deps); + Log.Debug("CheckDeps result: {@dep}",dep); + // Deal with the dependency test results + Dictionary depsDict = new(); + if (dep.Item2 is null) + { + Log.Debug("Ignoring dependency check as no dependencies listed"); + } + else + { + depsDict = dep.Item2; + } + if (!dep.Item1) + { + foreach (var dependency in depsDict) + { + Log.Error("Dependency {dependency} Cannot be found\nPlease install it or check it is in your PATH",dependency.Key); + } + Log.CloseAndFlush(); + Environment.Exit(1); + } + + + + Log.CloseAndFlush(); return 0; }