public bool CheckVersionFile(string folder) { var versionFile = Path.Combine(syncFileService.GetAbsPath(folder), "usync.config"); if (!syncFileService.FileExists(versionFile)) { return(false); } else { try { var node = syncFileService.LoadXElement(versionFile); var format = node.Attribute("format").ValueOrDefault(""); if (!format.InvariantEquals(uSyncConstants.FormatVersion)) { var expectedVersion = SemVersion.Parse(uSyncConstants.FormatVersion); if (SemVersion.TryParse(format, out SemVersion current)) { if (current.CompareTo(expectedVersion) >= 0) { return(true); } } return(false); } } catch { return(false); } } return(true); }
private bool HasStopFile(string folder) => syncFileService.FileExists($"{folder}/usync.stop");