bool PackageExists(Package package) { string path = Path.Combine(_options.OutputDirectory ?? "", package.Id); if (!_options.ExcludeVersion) { path = path + "." + package.Version; } return Directory.Exists(path); }
void RetrievePackage(Package package) { foreach (string source in _options.Sources) { PackageManager packageManager = GetPackageManager(source); packageManager.InstallPackage(package.Id, new Version(package.Version)); if (PackageExists(package)) { break; } } }