private async Task InstallPackageCore(GraphItem installItem, string packagesDirectory) { using (var memoryStream = new MemoryStream()) { var match = installItem.Match; await match.Provider.CopyToAsync(installItem.Match, memoryStream); memoryStream.Seek(0, SeekOrigin.Begin); await NuGetPackageUtils.InstallFromStream(memoryStream, match.Library, packagesDirectory, Reports.Information); } }
private Func <string, bool> ChainPredicate(Func <string, bool> predicate, GraphItem item, LibraryDependency dependency) { return(name => { if (item.Match.Library.Name == name) { throw new Exception(string.Format("TODO: Circular dependency references not supported. Package '{0}'.", name)); } if (item.Dependencies.Any(d => d != dependency && d.Name == name)) { return false; } return predicate(name); }); }
private Func <string, bool> ChainPredicate(Func <string, bool> predicate, GraphItem item, LibraryDependency dependency) { return(name => { if (item.Match.Library.Name == name) { throw new InvalidOperationException($"A circular reference to '{name}' was detected."); } if (item.Dependencies.Any(d => d != dependency && d.Name == name)) { return false; } return predicate(name); }); }
private Func<string, bool> ChainPredicate(Func<string, bool> predicate, GraphItem item, LibraryDependency dependency) { return name => { if (item.Match.Library.Name == name) { throw new InvalidOperationException($"A circular reference to '{name}' was detected."); } if (item.Dependencies.Any(d => d != dependency && d.Name == name)) { return false; } return predicate(name); }; }
private Func<string, bool> ChainPredicate(Func<string, bool> predicate, GraphItem item, LibraryDependency dependency) { return name => { if (item.Match.Library.Name == name) { throw new Exception(string.Format("TODO: Circular dependency references not supported. Package '{0}'.", name)); } if (item.Dependencies.Any(d => d != dependency && d.Name == name)) { return false; } return predicate(name); }; }