Пример #1
0
        public static IEnumerable <DotNetCoreGlobalToolItem> DotNetCoreGlobalToolList(this ICakeContext context, DotNetCoreGlobalToolListSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (settings == null)
            {
                settings = new DotNetCoreGlobalToolListSettings();
            }

            var runner = new DotNetCoreGlobalToolList(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);

            return(runner.List(settings));
        }
Пример #2
0
        public static bool DotNetCoreGlobalToolIsInstalled(this ICakeContext context, string packageId, DotNetCoreGlobalToolListSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var items = context.DotNetCoreGlobalToolList(settings);

            return(items.Any(x => x.Id.Equals(packageId, StringComparison.OrdinalIgnoreCase)));
        }