private RepositorySource CreateSource(RepositoryIndexEntry entry) { var repositoryPath = Path.Combine(RepositorySourceDirectory, entry.Id); PathEx.CreatePath(repositoryPath); return(new RepositorySource(entry.Url, repositoryPath)); }
//public bool TryGet(string name, out RepositorySource repository) //{ // return sources.TryGetValue(name, out repository); //} private RepositorySource CreateSource(RepositoryIndexEntry entry) { var repositoryPath = Path.Combine(RepositorySourceDirectory, entry.Id); if (!Directory.Exists(repositoryPath)) { Directory.CreateDirectory(repositoryPath); } return(new RepositorySource(entry.Url, repositoryPath) { //... }); }
public RepositoryIndexEntry GetOrCreate(string url) { lock (lockHandle) { if (entries.TryGetValue(url, out var entry)) { return(entry); } entry = new RepositoryIndexEntry(url); entries[url] = entry; try { Save(); } catch (Exception error) { Log.Error("Failed to save repository index!", error); } return(entry); } }