Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/GitVersionTfsTask/GitVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ var updateAssemblyInfo = tl.getBoolInput('updateAssemblyInfo');
var updateAssemblyInfoFilename = tl.getInput('updateAssemblyInfoFilename');
var additionalArguments = tl.getInput('additionalArguments');
var gitVersionPath = tl.getInput('gitVersionPath');
var targetPath = tl.getInput('targetPath');
var preferBundledVersion = tl.getBoolInput('preferBundledVersion');

var currentDirectory = __dirname;

var sourcesDirectory = tl.getVariable("Build.SourcesDirectory")
var workingDirectory = !targetPath
? tl.getVariable("Build.SourcesDirectory")
: path.join(tl.getVariable("Build.SourcesDirectory"), targetPath);

if (!gitVersionPath) {
gitVersionPath = tl.which("GitVersion.exe");
Expand Down Expand Up @@ -47,7 +50,7 @@ if (!gitVersionPath) {
}

toolRunner.arg([
sourcesDirectory,
workingDirectory,
"/output",
"buildserver",
"/nofetch"
Expand Down
9 changes: 9 additions & 0 deletions src/GitVersionTfsTask/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,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