public PackagePath(
     PackageInstallerOptions options,
     PackagePathSegments p,
     bool isPrivate)
 {
     this.Options   = options;
     this.isPrivate = isPrivate;
     this.Package   = p.Package;
     this.Version   = p.Version;
     this.Path      = p.Path;
 }
Esempio n. 2
0
        public PackageInstallerService(
            IServiceProvider services,
            PackageInstallerOptions options,
            Func <IServiceProvider, PackagePathSegments, Task <string> > versionProvider = null)
        {
            this.versionProvider = versionProvider;
            var reg = options.NPMRegistry.TrimEnd('/') + "/";

            this.Options             = options;
            this.Options.NPMRegistry = reg;
            this.privatePackages     = options.PrivatePackages.Select(x => {
                return(new PackagePath(options, x.ParseNPMPath(), true));
            });
            this.cache    = new AtomicCache <NodeInstalledPackage>();
            this.services = services;
        }