Example #1
0
        private bool PackageHasBeenRestored(
            ToolManifestPackage package,
            string targetFramework)
        {
            var sampleRestoredCommandIdentifierOfThePackage = new RestoredCommandIdentifier(
                package.PackageId,
                package.Version,
                NuGetFramework.Parse(targetFramework),
                Constants.AnyRid,
                package.CommandNames.First());

            return(_localToolsResolverCache.TryLoad(
                       sampleRestoredCommandIdentifierOfThePackage,
                       out var restoredCommand) &&
                   _fileSystem.File.Exists(restoredCommand.Executable.Value));
        }
Example #2
0
        private bool PackageHasBeenRestored(
            ToolManifestPackage package,
            string targetFramework)
        {
            var sampleRestoredCommandIdentifierOfThePackage = new RestoredCommandIdentifier(
                package.PackageId,
                package.Version,
                NuGetFramework.Parse(targetFramework),
                "any",
                package.CommandNames.First());

            if (_localToolsResolverCache.TryLoad(
                    sampleRestoredCommandIdentifierOfThePackage,
                    _nugetGlobalPackagesFolder,
                    out _))
            {
                return(true);
            }

            return(false);
        }