public void CopyDirectory(string from, string to, IEnumerable <string> excludes, IEnumerable <string> includes) { if (!DirectoryUtils.DirectoryExists(to) || DirectoryUtils.GetLastModTimeForDirectory(from) > DirectoryUtils.GetLastModTimeForDirectory(to)) { DirectoryUtils.CopyDirectory(from, to, excludes, includes); } }
public DateTime GetLastModTimeForPath(string path) { if (DirectoryUtils.DirectoryExists(path)) { return(DirectoryUtils.GetLastModTimeForDirectory(path)); } else if (FileUtils.FileExists(path)) { return(FileUtils.LastWriteTimeForFile(path)); } else { throw new FileNotFoundException(String.Format("file not found `{0}'", path)); } }
public override void Build(IBounce bounce) { bounce.Log.Debug("pwd"); bounce.Log.Debug(System.IO.Directory.GetCurrentDirectory()); if (DirectoryUtils.DirectoryExists(WorkingDirectory)) { GitCommand.Pull(WorkingDirectory, bounce.Log, bounce); } else { var options = GetCommandOptions(); GitCommand.Clone(Repository.Value, WorkingDirectory, options, bounce.Log, bounce); } }