public void Remove(IEnvLocalFeed feed, IActivityMonitor m, IEnumerable <ArtifactInstance> artifacts)
 {
     foreach (var n in artifacts)
     {
         if (n.Artifact.Type == NPMClient.NPMType)
         {
             var f = NPMEnvLocalFeedProviderExtension.GetNPMPackagePath(feed.PhysicalPath, n.Artifact.Name, n.Version);
             if (System.IO.File.Exists(f))
             {
                 System.IO.File.Delete(f);
                 m.Info($"Removed {n} from {feed.PhysicalPath}.");
             }
         }
     }
 }
Ejemplo n.º 2
0
 public static IEnumerable <LocalNPMPackageFile> GetAllNPMPackageFiles(this IEnvLocalFeed @this, IActivityMonitor m)
 {
     return(NPMEnvLocalFeedProviderExtension.GetAllNPMPackageFiles(m, @this.PhysicalPath));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets a <see cref="LocalNPMPackageFile"/> or null if not found.
        /// </summary>
        /// <param name="m">The monitor to use.</param>
        /// <param name="packageId">The package name.</param>
        /// <param name="v">The package version.</param>
        /// <returns>The local package file or null if not found.</returns>
        public static LocalNPMPackageFile GetNPMPackageFile(this IEnvLocalFeed @this, IActivityMonitor m, string packageId, SVersion v)
        {
            var f = NPMEnvLocalFeedProviderExtension.GetNPMPackagePath(@this.PhysicalPath, packageId, v);

            return(System.IO.File.Exists(f) ? new LocalNPMPackageFile(f, packageId, v) : null);
        }