added buildAgent.getSourceDir
This commit is contained in:
16
dist/github/execute/index.js
vendored
16
dist/github/execute/index.js
vendored
File diff suppressed because one or more lines are too long
16
dist/github/setup/index.js
vendored
16
dist/github/setup/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -61,6 +61,10 @@ class BuildAgent implements IBuildAgent {
|
||||
});
|
||||
}
|
||||
|
||||
public getSourceDir(): string {
|
||||
return this.getVariable("Build.SourcesDirectory");
|
||||
}
|
||||
|
||||
public getInput(input: string, required?: boolean): string {
|
||||
return taskLib.getInput(input, required);
|
||||
}
|
||||
|
||||
@@ -146,10 +146,13 @@ class DotnetTool implements IDotnetTool {
|
||||
@injectable()
|
||||
class GitVersionTool implements IGitVersionTool {
|
||||
|
||||
private buildAgent: IBuildAgent;
|
||||
private dotnetTool: IDotnetTool;
|
||||
constructor(
|
||||
@inject(TYPES.IBuildAgent) buildAgent: IBuildAgent,
|
||||
@inject(TYPES.IDotnetTool) dotnetTool: IDotnetTool,
|
||||
) {
|
||||
this.buildAgent = buildAgent;
|
||||
this.dotnetTool = dotnetTool;
|
||||
}
|
||||
|
||||
@@ -158,6 +161,8 @@ class GitVersionTool implements IGitVersionTool {
|
||||
}
|
||||
|
||||
public run(options: IGitVersionOptions): Promise<IExecResult> {
|
||||
console.log("Workspace: " + this.buildAgent.getSourceDir());
|
||||
|
||||
console.log(options);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,10 @@ class BuildAgent implements IBuildAgent {
|
||||
};
|
||||
}
|
||||
|
||||
public getSourceDir(): string {
|
||||
return this.getVariable("GITHUB_WORKSPACE");
|
||||
}
|
||||
|
||||
public getInput(input: string, required?: boolean): string {
|
||||
return core.getInput(input, { required } as core.InputOptions);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ export interface IBuildAgent {
|
||||
addPath: (inputPath: string) => void;
|
||||
which: (tool: string, check?: boolean) => Promise<string>;
|
||||
exec: (exec: string, args: string[]) => Promise<IExecResult>;
|
||||
getSourceDir: () => string;
|
||||
|
||||
getInput(input: string, required?: boolean): string;
|
||||
getBooleanInput(input: string, required?: boolean): boolean;
|
||||
|
||||
Reference in New Issue
Block a user