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 {
1212 const updateAssemblyInfo = tl . getBoolInput ( 'updateAssemblyInfo' ) ;
1313 const updateAssemblyInfoFilename = tl . getInput ( 'updateAssemblyInfoFilename' ) ;
1414 const additionalArguments = tl . getInput ( 'additionalArguments' ) ;
15+ const targetPath = tl . getInput ( 'targetPath' ) ;
1516 const preferBundledVersion = tl . getBoolInput ( 'preferBundledVersion' ) ;
1617
1718 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 ) ;
1922
2023 let gitVersionPath = tl . getInput ( 'gitVersionPath' ) ;
2124 if ( ! gitVersionPath ) {
@@ -69,7 +72,7 @@ export class GitVersionTask {
6972 }
7073
7174 toolRunner . arg ( [
72- sourcesDirectory ,
75+ workingDirectory ,
7376 "/output" ,
7477 "buildserver" ,
7578 "/nofetch" ] ) ;
Original file line number Diff line number Diff line change 5454 "helpMarkDown" : " Optionally supply the path to GitVersion.exe" ,
5555 "groupName" : " additional"
5656 },
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+ },
5766 {
5867 "name" : " preferBundledVersion" ,
5968 "type" : " boolean" ,
You can’t perform that action at this time.
0 commit comments