Sync eng/common directory with azure-sdk-tools for PR 9823 (#6419)
* handle defaults for changedfiles, deletedfiles, and changedServices --------- Co-authored-by: Scott Beddall <scbedd@microsoft.com>
This commit is contained in:
parent
a5e9424161
commit
e4dae4e2a5
@ -53,6 +53,10 @@ $deletedFiles = Get-ChangedFiles -DiffPath $TargetPath -DiffFilterType "D"
|
||||
if ($changedFiles) {
|
||||
$changedServices = Get-ChangedServices -ChangedFiles $changedFiles
|
||||
}
|
||||
else {
|
||||
# ensure we default this to an empty array if not set
|
||||
$changedFiles = @()
|
||||
}
|
||||
|
||||
# ExcludePaths is an object array with the default of [] which evaluates to null.
|
||||
# If the value is null, set it to empty list to ensure that the empty list is
|
||||
@ -60,6 +64,12 @@ if ($changedFiles) {
|
||||
if (-not $ExcludePaths) {
|
||||
$ExcludePaths = @()
|
||||
}
|
||||
if (-not $deletedFiles) {
|
||||
$deletedFiles = @()
|
||||
}
|
||||
if (-not $changedServices) {
|
||||
$changedServices = @()
|
||||
}
|
||||
$result = [PSCustomObject]@{
|
||||
"ChangedFiles" = $changedFiles
|
||||
"ChangedServices" = $changedServices
|
||||
|
||||
Loading…
Reference in New Issue
Block a user