示例#1
0
        /// <summary>
        /// Add a remove entry and return the page commit.
        /// </summary>
        private async Task <JObject> GetRemoveCommit(PackageIdentity package)
        {
            // Create package details page for the delete
            var packageDetails = await CatalogUtility.CreateDeleteDetailsAsync(package, string.Empty, CatalogBaseURI, _context.CommitId);

            var packageDetailsFile = _context.Source.Get(packageDetails.GetEntityId());

            await packageDetailsFile.Write(packageDetails, _context.Log, _context.Token);

            // Create commit
            return(CatalogUtility.CreatePageCommit(
                       package,
                       packageDetailsFile.EntityUri,
                       _context.CommitId,
                       SleetOperation.Remove,
                       "nuget:PackageDelete"));
        }
示例#2
0
文件: Catalog.cs 项目: skarllot/Sleet
        public async Task RemovePackageAsync(PackageIdentity package)
        {
            // Create package details page for the delete
            var packageDetails = await CatalogUtility.CreateDeleteDetailsAsync(package, string.Empty, CatalogBaseURI, _context.CommitId);

            var packageDetailsFile = _context.Source.Get(packageDetails.GetEntityId());

            await packageDetailsFile.Write(packageDetails, _context.Log, _context.Token);

            // Create commit
            var pageCommit = CatalogUtility.CreatePageCommit(
                package,
                packageDetailsFile.EntityUri,
                _context.CommitId,
                SleetOperation.Remove,
                "nuget:PackageDelete");

            await AddCatalogEntry(pageCommit, "nuget:lastDeleted");
        }