Example #1
0
    private static void ValidateConfig(Config.Config config, bool justReturnErrors = false)
    {
        var buildConfigErrors = BuildCommand.ValidateConfig(config, false);
        var v = new Config.Validator("publish", buildConfigErrors);

        v.AddIfEmpty(config.AuthConfig.AuthToken, "Auth AuthToken");
        v.ThrowIfErrors();
    }
Example #2
0
    private static void ValidateConfig(Config.Config config)
    {
        var v = new Config.Validator("init");

        v.AddIfEmpty(config.PackageMeta.Namespace, "Package Namespace");
        v.AddIfEmpty(config.PackageMeta.Name, "Package Name");
        v.AddIfNotSemver(config.PackageMeta.VersionNumber, "Package VersionNumber");
        v.AddIfNull(config.PackageMeta.Description, "Package Description");
        v.AddIfNull(config.PackageMeta.WebsiteUrl, "Package WebsiteUrl");
        v.AddIfNull(config.PackageMeta.ContainsNsfwContent, "Package ContainsNsfwContent");
        v.AddIfNull(config.PackageMeta.Dependencies, "Package Dependencies");
        v.AddIfEmpty(config.BuildConfig.IconPath, "Build IconPath");
        v.AddIfEmpty(config.BuildConfig.ReadmePath, "Build ReadmePath");
        v.AddIfEmpty(config.BuildConfig.OutDir, "Build OutDir");
        v.AddIfEmpty(config.PublishConfig.Repository, "Publish Repository");
        v.ThrowIfErrors();
    }