Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools repository for Tools P…
Browse files Browse the repository at this point in the history
…R 974 (#14929)
  • Loading branch information
azure-sdk authored Sep 16, 2020
1 parent 492fcad commit 1d545e0
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eng/common/scripts/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $EngScriptsDir = Join-Path $EngDir "scripts"
. (Join-Path $EngCommonScriptsDir SemVer.ps1)
. (Join-Path $EngCommonScriptsDir ChangeLog-Operations.ps1)
. (Join-Path $EngCommonScriptsDir Package-Properties.ps1)
. (Join-Path $EngCommonScriptsDir logging.ps1)

# Setting expected from common languages settings
$Language = "Unknown"
Expand All @@ -20,7 +21,7 @@ $EngScriptsLanguageSettings = Join-path $EngScriptsDir "Language-Settings.ps1"
if (Test-Path $EngScriptsLanguageSettings) {
. $EngScriptsLanguageSettings
}
If ($LanguageShort -eq $null)
if (-not $LanguageShort)
{
$LangaugeShort = $Language
}
Expand Down
40 changes: 40 additions & 0 deletions eng/common/scripts/logging.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
if (-not $isDevOpsRun)
{
$isDevOpsRun = ($null -ne $env:SYSTEM_TEAMPROJECTID)
}

function LogWarning
{
if ($isDevOpsRun)
{
Write-Host "##vso[task.LogIssue type=warning;]$args"
}
else
{
Write-Warning "$args"
}
}

function LogError
{
if ($isDevOpsRun)
{
Write-Host "##vso[task.LogIssue type=error;]$args"
}
else
{
Write-Error "$args"
}
}

function LogDebug
{
if ($isDevOpsRun)
{
Write-Host "##vso[task.LogIssue type=debug;]$args"
}
else
{
Write-Debug "$args"
}
}

0 comments on commit 1d545e0

Please sign in to comment.