Exemplo n.º 1
0
        private IEnumerable <Package> Packages()
        {
            IList <Package> packages = new List <Package>();

            foreach (var packagePath in Directory.GetFiles(Config.PackageRepositoryPath, "*.nupkg").OrderByDescending(x => x))
            {
                packages.Add(Package.FromNupkg(packagePath, packages));
            }
            return(packages);
        }
Exemplo n.º 2
0
        internal dynamic PushPackage(dynamic request)
        {
            var tempFileName = Path.GetTempFileName();

            using (var packageStream = new FileStream(tempFileName, FileMode.Create)){
                Request.Files.First(x => x.Name == "package").Value.CopyTo(packageStream);
            }
            Package package = Package.FromNupkg(tempFileName);

            File.Copy(tempFileName, Path.Combine(Config.PackageRepositoryPath, string.Format("{0}.{1}.nupkg", package.Id, package.Version)), true);
            File.Delete(tempFileName);
            return(new Response());
        }
Exemplo n.º 3
0
        private IEnumerable <Package> Packages()
        {
            IList <Package> packages = new List <Package>();

            foreach (var packagePath in Directory.GetFiles(Config.PackageRepositoryPath, "*.nupkg").OrderByDescending(x => x))
            {
                packages.Add(Package.FromNupkg(packagePath));
            }

            foreach (var package in packages)
            {
                package.IsLatestVersion = package.IsAbsoluteLatestVersion = !packages.Any(x => x.Version > package.Version && x.Id == package.Id);
            }

            return(packages);
        }