Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
fix(script): fix support for release definition
Browse files Browse the repository at this point in the history
  • Loading branch information
fakhrulhilal committed May 6, 2018
1 parent a3a8315 commit 109ce9c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions GitDownloader/GitDownloader.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ Function Get-GitRepositoryUri {
Return $Uris -join '/'
}

Function Get-GitDirectory {
If (-not ([string]::IsNullOrWhiteSpace($Env:AGENT_BUILDDIRECTORY)) -and (Test-Path -Path $Env:AGENT_BUILDDIRECTORY -PathType Container)) {
$Directory = $Env:AGENT_BUILDDIRECTORY
} ElseIf (-not ([string]::IsNullOrWhiteSpace($Env:AGENT_RELEASEDIRECTORY)) -and (Test-Path $Env:AGENT_RELEASEDIRECTORY -PathType Container)) {
$Directory = $Env:AGENT_RELEASEDIRECTORY
}

Return ([System.IO.Path]::Combine($Directory, 'git'))
}

Function Test-SameTfsServer {
param([string]$Uri)
$DefaultUri = $Env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI
Expand All @@ -159,8 +169,7 @@ try {
$GitRepositoryUri = Get-GitRepositoryUri
Write-Host "##vso[task.setvariable variable=Build.Repository.GitUri]$GitRepositoryUri"
$RepositoryUrl = $RepositoryUrl -replace ([regex]::Escape('$(Build.Repository.GitUri)')), $GitRepositoryUri
$BuildDirectory = $Env:AGENT_BUILDDIRECTORY
$GitDirectory = [System.IO.Path]::Combine($BuildDirectory, 'git')
$GitDirectory = Get-GitDirectory
Write-Host "##vso[task.setvariable variable=Build.GitDirectory]$GitDirectory"
If ([string]::IsNullOrWhiteSpace($RepositoryPath)) {
# set default repository path
Expand Down
2 changes: 1 addition & 1 deletion GitDownloader/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 12
"Patch": 15
},
"instanceNameFormat": "Fetch git: $(Repository)",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "GitDownloader",
"name": "Git Repository Downloader",
"version": "0.2.12",
"version": "0.2.15",
"publisher": "fakhrulhilal-maktum",
"targets": [
{
Expand Down

0 comments on commit 109ce9c

Please sign in to comment.