Skip to content

Commit

Permalink
[New-TestResources.ps1] Handle multiple segments in service directory…
Browse files Browse the repository at this point in the history
… path (#2065)

This is primary to support second level nesting in service directories introduced by go (e.g. `sdk/keyvault/azsecrets`). See [related](Azure/azure-sdk-for-go#15603 (review)).
  • Loading branch information
benbp authored Oct 5, 2021
1 parent c90f9ab commit 5bd18b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,9 @@ try {
$sp.Id
}

# If the ServiceDirectory is an absolute path use the last directory name
# (e.g. D:\foo\bar\ -> bar)
$serviceName = if (Split-Path -IsAbsolute $ServiceDirectory) {
# If the ServiceDirectory has multiple segments use the last directory name
# e.g. D:\foo\bar -> bar or foo/bar -> bar
$serviceName = if (Split-Path $ServiceDirectory) {
Split-Path -Leaf $ServiceDirectory
} else {
$ServiceDirectory
Expand Down Expand Up @@ -916,4 +916,4 @@ Run this in an Azure DevOps CI (with approrpiate variables configured) before
executing live tests. The script will output variables as secrets (to enable
log redaction).
#>
#>

0 comments on commit 5bd18b7

Please sign in to comment.