File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,13 @@ export class GitVersionTask {
12
12
const updateAssemblyInfo = tl . getBoolInput ( 'updateAssemblyInfo' ) ;
13
13
const updateAssemblyInfoFilename = tl . getInput ( 'updateAssemblyInfoFilename' ) ;
14
14
const additionalArguments = tl . getInput ( 'additionalArguments' ) ;
15
+ const targetPath = tl . getInput ( 'targetPath' ) ;
15
16
const preferBundledVersion = tl . getBoolInput ( 'preferBundledVersion' ) ;
16
17
17
18
const currentDirectory = __dirname ;
18
- const sourcesDirectory = tl . getVariable ( "Build.SourcesDirectory" ) || "." ;
19
+ const workingDirectory = ! targetPath
20
+ ? tl . getVariable ( "Build.SourcesDirectory" )
21
+ : path . join ( tl . getVariable ( "Build.SourcesDirectory" ) , targetPath ) ;
19
22
20
23
let gitVersionPath = tl . getInput ( 'gitVersionPath' ) ;
21
24
if ( ! gitVersionPath ) {
@@ -69,7 +72,7 @@ export class GitVersionTask {
69
72
}
70
73
71
74
toolRunner . arg ( [
72
- sourcesDirectory ,
75
+ workingDirectory ,
73
76
"/output" ,
74
77
"buildserver" ,
75
78
"/nofetch" ] ) ;
Original file line number Diff line number Diff line change 54
54
"helpMarkDown" : " Optionally supply the path to GitVersion.exe" ,
55
55
"groupName" : " additional"
56
56
},
57
+ {
58
+ "name" : " targetPath" ,
59
+ "type" : " string" ,
60
+ "label" : " Working directory path" ,
61
+ "defaultValue" : " " ,
62
+ "required" : false ,
63
+ "helpMarkDown" : " Optionally supply the path to the working directory" ,
64
+ "groupName" : " additional"
65
+ },
57
66
{
58
67
"name" : " preferBundledVersion" ,
59
68
"type" : " boolean" ,
You can’t perform that action at this time.
0 commit comments