public void InstallOrUpdateWebJob() { // ensure the WebJobDirectory exists if (!Directory.Exists(WebJobDirectory)) { Directory.CreateDirectory(WebJobDirectory); } // Copy all files from the src directory to the WebJobDirectory DirectoryEx.Copy(SrcDirectory, WebJobDirectory, true); }
public static void Copy(string sourceDir, string targetDir, bool overwrite = false) { Directory.CreateDirectory(targetDir); foreach (var file in Directory.GetFiles(sourceDir)) { File.Copy(file, Path.Combine(targetDir, Path.GetFileName(file)), overwrite); } foreach (var directory in Directory.GetDirectories(sourceDir)) { DirectoryEx.Copy(directory, Path.Combine(targetDir, Path.GetFileName(directory)), overwrite); } }