Skip to content

Commit

Permalink
Update test-example.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisherAmonulloev committed Dec 16, 2024
1 parent febd419 commit 5181351
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions test-example.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -146,35 +146,12 @@ function Set-BuildVersion {
Write-Output "New List: $updatedList"
}

function Set-TestingFailed {
$TempDirectory = Join-Path -Path $env:WORKSPACE -ChildPath "TEMP"
if (-not (Test-Path -Path $TempDirectory)) {
Write-Output "`nCreating a temp directory at $TempDirectory"
New-Item -ItemType Directory -Path $TempDirectory | Out-Null
}

$ReadmeFile = Join-Path -Path $TempDirectory -ChildPath "README.md"

$Content = "Example testing failed: [Example testing failed](https://example-testing-failed.com/)"
Write-Output "`nWriting a file with invalid link to a temp directory at $TempDirectory"
Set-Content -Path $ReadmeFile -Value $Content
}

Write-Output "`nBranch Name: $env:branchName"

Set-BuildVersion
if (-not $global:buildVersion) {
Write-Output "`nThe buildVersion is null or an empty string."
Set-TestingFailed
[System.Environment]::Exit($global:errorCode)
}
Process-JavaScriptProjects -buildVersion $global:buildVersion
Process-DotNetProjects

Write-Output "`nFinished testing. Error code: $global:errorCode"

if ($global:errorCode -ne 0) {
Set-TestingFailed
}

[System.Environment]::Exit($global:errorCode)

0 comments on commit 5181351

Please sign in to comment.