Exemplo n.º 1
0
        public static void NpmDistTagAdd(this ICakeContext context, string package, string version, string tag, Action <NpmDistTagSettings> configurator = null)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (string.IsNullOrEmpty(package))
            {
                throw new ArgumentNullException(nameof(package));
            }
            if (string.IsNullOrEmpty(version))
            {
                throw new ArgumentNullException(nameof(version));
            }
            if (string.IsNullOrEmpty(tag))
            {
                throw new ArgumentNullException(nameof(tag));
            }

            NpmDistTagSettings s = new NpmDistTagSettings()
            {
                Package = package,
                Version = version,
                Tag     = tag,
            };

            configurator?.Invoke(s);

            new NpmDistTagRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log).RunDistTags(s);
        }
Exemplo n.º 2
0
        public static void NpmDistTag(this ICakeContext context, NpmDistTagSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            new NpmDistTagRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log).RunDistTags(settings);
        }