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}.");
             }
         }
     }
 }
Exemple #2
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);
        }