Ejemplo n.º 1
0
        public string GetRealPath(NugetLocalPackage package)
        {
            if (IsDevRedirectPackage(package) && package.Version < new PackageVersion(3, 1, 0, 0))
            {
                var realPath = File.ReadAllText(GetRedirectFile(package));
                if (!Directory.Exists(realPath))
                {
                    throw new DirectoryNotFoundException();
                }
                return(realPath);
            }

            return(package.Path);
        }
Ejemplo n.º 2
0
 public bool IsDevRedirectPackage(NugetLocalPackage package)
 {
     return(package.Version < new PackageVersion(3, 1, 0, 0)
         ? File.Exists(GetRedirectFile(package))
         : (package.Version.SpecialVersion != null && package.Version.SpecialVersion.StartsWith("dev") && !package.Version.SpecialVersion.Contains('.')));
 }
Ejemplo n.º 3
0
 public string GetRedirectFile(NugetLocalPackage package)
 {
     return(Path.Combine(package.Path, $"{package.Id}.redirect"));
 }