<commit_before>import * as path from "path";
import * as Q  from "q";
import * as tl from "vsts-task-lib/task";

import * as auth from "nuget-task-common/Authentication";
import INuGetCommandOptions from "nuget-task-common/INuGetCommandOptions";
import locationHelpers = require("nuget-task-common/LocationHelpers");
import {NuGetConfigHelper} from "nuget-task-common/NuGetConfigHelper";
import * as ngToolRunner from "nuget-task-common/NuGetToolRunner";
import * as nutil from "nuget-task-common/Utility";

class PublishOptions implements INuGetCommandOptions {
    constructor(
        public nuGetPath: string,
        public feedUri: string,
        public apiKey: string,
        public configFile: string,
        public verbosity: string,
        public extraArgs: string,
        public environment: ngToolRunner.NuGetEnvironmentSettings
    ) { }
}

async function main(): Promise<void> {
    let buildIdentityDisplayName: string = null;
    let buildIdentityAccount: string = null;
    try {
        tl.setResourcePath(path.join(__dirname, "task.json"));

        nutil.setConsoleCodePage();

        // read inputs
        let searchPattern = tl.getPathInput("searchPattern", true, false);
        let failOnEmptyNupkgMatch = tl.getBoolInput("failOnEmptyNupkgMatch");
        let filesList = nutil.resolveFilterSpec(
            searchPattern,
            tl.getVariable("System.DefaultWorkingDirectory") || process.cwd(),
            failOnEmptyNupkgMatch);
        filesList.forEach(packageFile => {
            if (!tl.stats(packageFile).isFile()) {
                throw new Error(tl.loc("NotARegularFile", packageFile));
            }
        });

        let connectedServiceName = tl.getInput("connectedServiceName");
        let internalFeedUri = tl.getInput("feedName");
        let nuGetAdditionalArgs = tl.getInput("nuGetAdditionalArgs");
        let verbosity = tl.getInput("verbosity");

        let nuGetFeedType = tl.getInput("nuGetFeedType") || "external";
        // make sure the feed type is an expected one
        let normalizedNuGetFeedType
            = ["internal", "external"].find(x => nuGetFeedType.toUpperCase() === x.toUpperCase());<commit_msg>fixup! Add option to not fail on empty nupkg match in NuGetPublisher task.<commit_after>import * as path from "path";
import * as Q  from "q";
import * as tl from "vsts-task-lib/task";

import * as auth from "nuget-task-common/Authentication";
import INuGetCommandOptions from "nuget-task-common/INuGetCommandOptions";
import locationHelpers = require("nuget-task-common/LocationHelpers");
import {NuGetConfigHelper} from "nuget-task-common/NuGetConfigHelper";
import * as ngToolRunner from "nuget-task-common/NuGetToolRunner";
import * as nutil from "nuget-task-common/Utility";

class PublishOptions implements INuGetCommandOptions {
    constructor(
        public nuGetPath: string,
        public feedUri: string,
        public apiKey: string,
        public configFile: string,
        public verbosity: string,
        public extraArgs: string,
        public environment: ngToolRunner.NuGetEnvironmentSettings
    ) { }
}

async function main(): Promise<void> {
    let buildIdentityDisplayName: string = null;
    let buildIdentityAccount: string = null;
    try {
        tl.setResourcePath(path.join(__dirname, "task.json"));

        nutil.setConsoleCodePage();

        // read inputs
        let searchPattern = tl.getPathInput("searchPattern", true, false);
        let allowEmptyMatch = !tl.getBoolInput("failOnEmptyNupkgMatch");
        let filesList = nutil.resolveFilterSpec(
            searchPattern,
            tl.getVariable("System.DefaultWorkingDirectory") || process.cwd(),
            allowEmptyMatch);
        filesList.forEach(packageFile => {
            if (!tl.stats(packageFile).isFile()) {
                throw new Error(tl.loc("NotARegularFile", packageFile));
            }
        });

        let connectedServiceName = tl.getInput("connectedServiceName");
        let internalFeedUri = tl.getInput("feedName");
        let nuGetAdditionalArgs = tl.getInput("nuGetAdditionalArgs");
        let verbosity = tl.getInput("verbosity");

        let nuGetFeedType = tl.getInput("nuGetFeedType") || "external";
        // make sure the feed type is an expected one
        let normalizedNuGetFeedType
            = ["internal", "external"].find(x => nuGetFeedType.toUpperCase() === x.toUpperCase());
{'fraction_non_alphanumeric': 0.10842009959257583, 'fraction_numerical': 0.0, 'mean_word_length': 3.2490384615384613, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6872599', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1216, 'n_words': 287}