Skip to content

Commit 5d66396

Browse files
authored
Make azure_core_amqp/Test-Setup.ps1 reentrant (Azure#4424)
1 parent 1eaee60 commit 5d66396

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

sdk/core/azure_core_amqp/Test-Setup.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if ($IsMacOS) {
1212
}
1313

1414
# Create the test binary *outside* the repo root to avoid polluting the repo.
15-
$WorkingDirectory = ([System.IO.Path]::Combine($RepoRoot, "../TestArtifacts"))
15+
$WorkingDirectory = [System.IO.Path]::Combine($RepoRoot, "../TestArtifacts")
1616

1717
# Create the working directory if it does not exist.
1818
Write-Host "Using Working Directory $WorkingDirectory"
@@ -28,10 +28,15 @@ Push-Location -Path $WorkingDirectory
2828
# Clone and build the Test Amqp Broker.
2929
try {
3030

31+
$repositoryDir = [System.IO.Path]::Combine($WorkingDirectory, "azure-amqp")
32+
if (Test-Path $repositoryDir) {
33+
Write-Host "Removing previously cloned repository: $repositoryDir"
34+
Remove-Item $repositoryDir -Force -Recurse | Out-Null
35+
}
36+
3137
$repositoryUrl = "https://github.com/Azure/azure-amqp.git"
3238
$repositoryHash = "d82a86455c3459c5628bc95b25511f6e8a065598"
33-
$cloneCommand = "git clone $repositoryUrl --revision $repositoryHash"
34-
39+
$cloneCommand = "git clone $repositoryUrl --revision $repositoryHash --depth=1"
3540

3641
Write-Host "Cloning repository from $repositoryUrl..."
3742
Invoke-LoggedCommand $cloneCommand

0 commit comments

Comments
 (0)