public async Task <InstalledPackage> Install(ISource source, PackageSpec package) { var pdir = GetPackageDir(package); if (Directory.Exists(pdir)) { throw new Exception("Package already installed."); } FS.EnsureDirectoryExists(pdir); var nupkgDest = GetNupkgPath(package); FS.EnsureParentDirectoryExists(nupkgDest); await source.Download(package, nupkgDest); ZipFile.ExtractToDirectory(nupkgDest, pdir); return(new InstalledPackage(this, package)); }