Skip to content

Commit

Permalink
Merge pull request GitTools#1594 from asbjornu/feature/tfstask-path-p…
Browse files Browse the repository at this point in the history
…arameter

Added path parameter to the TfsTask
  • Loading branch information
asbjornu authored Feb 20, 2019
2 parents 9f6fbbd + 74ee1c8 commit dd92719
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/GitVersionTfsTask/GitVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ export class GitVersionTask {
const updateAssemblyInfo = tl.getBoolInput('updateAssemblyInfo');
const updateAssemblyInfoFilename = tl.getInput('updateAssemblyInfoFilename');
const additionalArguments = tl.getInput('additionalArguments');
const targetPath = tl.getInput('targetPath');
const preferBundledVersion = tl.getBoolInput('preferBundledVersion');

const currentDirectory = __dirname;
const sourcesDirectory = tl.getVariable("Build.SourcesDirectory") || ".";
const workingDirectory = !targetPath
? tl.getVariable("Build.SourcesDirectory")
: path.join(tl.getVariable("Build.SourcesDirectory"), targetPath);

let gitVersionPath = tl.getInput('gitVersionPath');
if (!gitVersionPath) {
Expand Down Expand Up @@ -69,7 +72,7 @@ export class GitVersionTask {
}

toolRunner.arg([
sourcesDirectory,
workingDirectory,
"/output",
"buildserver",
"/nofetch"]);
Expand Down
9 changes: 9 additions & 0 deletions src/GitVersionTfsTask/GitVersionTask/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
"helpMarkDown": "Optionally supply the path to GitVersion.exe",
"groupName": "additional"
},
{
"name": "targetPath",
"type": "string",
"label": "Working directory path",
"defaultValue": "",
"required": false,
"helpMarkDown": "Optionally supply the path to the working directory",
"groupName": "additional"
},
{
"name": "preferBundledVersion",
"type": "boolean",
Expand Down

0 comments on commit dd92719

Please sign in to comment.