-
Notifications
You must be signed in to change notification settings - Fork 42
/
input-parameters.ts
33 lines (31 loc) · 1.37 KB
/
input-parameters.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as tasks from "azure-pipelines-task-lib/task";
import { removeTrailingSlashes, safeTrim } from "tasksLegacy/Utils/inputs";
import { getLineSeparatedItems } from "../../Utils/inputs";
export interface InputParameters {
packageId: string;
packageVersion: string;
outputPath: string;
sourcePath: string;
include: string[];
nuGetDescription: string;
nuGetAuthors: string[];
nuGetTitle?: string;
nuGetReleaseNotes?: string;
nuGetReleaseNotesFile?: string;
overwrite?: boolean;
}
export const getInputs = (): InputParameters => {
return {
packageId: tasks.getInput("PackageId", true) || "",
packageVersion: tasks.getInput("PackageVersion", true) || "",
outputPath: removeTrailingSlashes(safeTrim(tasks.getPathInput("OutputPath"))) || ".",
sourcePath: removeTrailingSlashes(safeTrim(tasks.getPathInput("SourcePath"))) || ".",
include: getLineSeparatedItems(tasks.getInput("Include") || "**"),
nuGetDescription: tasks.getInput("NuGetDescription", true) || "",
nuGetAuthors: getLineSeparatedItems(tasks.getInput("NuGetAuthor", true) || ""),
nuGetTitle: tasks.getInput("NuGetTitle"),
nuGetReleaseNotes: tasks.getInput("NuGetReleaseNotes"),
nuGetReleaseNotesFile: tasks.getInput("NuGetReleaseNotesFile", false),
overwrite: tasks.getBoolInput("Overwrite"),
};
};