Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Azure pipelines variable #135

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 4 additions & 8 deletions BuildHelpers/Public/Get-ProjectName.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,17 @@ function Get-ProjectName
}
$result = $SourceManifests.BaseName
}
#PSD1 in root of project - ick, but happens.
#PSD1 in root of project
elseif( Test-Path "$ExpectedPath.psd1" )
{
$result = $CurrentFolder
}
#PSD1 in root of project but name doesn't match
#very ick or just an icky time in Azure Pipelines
elseif ( $PSDs = Get-ChildItem -Path $Path "*.psd1" )
#A single PSD1 in root of project but name doesn't match (maybe because of Azure pipeline's /s folders)
elseif ( ($PSDs = Get-ChildItem -Path $Path "*.psd1").Count -eq 1 )
{
if ($PSDs.count -gt 1) {
Write-Warning "Found more than one project manifest in the root folder"
}
$result = $PSDs.BaseName
}
#Last ditch, are you in Azure Pipelines or another CI that checks into a folder unrelated to the project?
#If you are in Azure Pipelines or another CI that checks into a folder unrelated to the project, maybe we should try this earlier?
#let's try some git
elseif ( $WeCanGit ) {
$result = (Invoke-Git -Path $Path -GitPath $GitPath -Arguments "remote get-url origin").Split('/')[-1] -replace "\.git",""
Expand Down
2 changes: 1 addition & 1 deletion BuildHelpers/Public/Set-BuildEnvironment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function Set-BuildEnvironment {
Write-Verbose "storing [$prefixedVar] with value '$($BuildHelpersVariables[$VarName])'."
$Output = New-Item -Path Env:\ -Name $prefixedVar -Value $BuildHelpersVariables[$VarName] -Force:$Force
if ("Azure Pipelines" -eq $BuildHelpersVariables["BuildSystem"]) {
Set-AzurePipelinesVariable -Name $prefixedVar -Value $BuildHelpersVariables[$VarName]
Set-AzurePipelinesVariable -Name $prefixedVar -Value "$($BuildHelpersVariables[$VarName])"
}
if($Passthru)
{
Expand Down