/// <summary> /// This function was added as a defensive measure where we saw a couple of times /// a file was created for what should have been a directory. This caused the /// build scripts to fail in a very non obvious way. /// /// </summary> /// <param name="path"></param> private static void DeleteIntermediateDirectory(string path) { if (File.Exists(path)) { GeneralFileOperations.DeleteFile(path); } if (Directory.Exists(path)) { GeneralFileOperations.DeleteDirectory(path); } }
/// <summary> /// Helper function to initialize a test set of files for development /// </summary> /// <param name="configuration">Main program configuration</param> /// <returns>Destination folder path. To use for other operations</returns> public static string PrepareWpdtTargetDirectory( BuildControlParameters configuration, DailyBuildFullResults results) { string sourcePath = configuration.WpdtLkgSourcePath; string destinationPath = configuration.WpdtLkgTargetPath; if (Directory.Exists(destinationPath)) { GeneralFileOperations.DeleteDirectory(destinationPath); } CopyWpdtLkgToTargetDirectory(sourcePath, destinationPath, results); return(destinationPath); }