File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -115,11 +115,28 @@ class PackageProps {
115115 return $null
116116 }
117117
118- [PSCustomObject ]GetCIYmlForArtifact () {
118+ [System.IO.FileInfo []]ResolveCIFolderPath () {
119119 $RepoRoot = Resolve-Path (Join-Path $PSScriptRoot " .." " .." " .." )
120-
121120 $ciFolderPath = Join-Path - Path $RepoRoot - ChildPath (Join-Path " sdk" $this.ServiceDirectory )
122- $ciFiles = @ (Get-ChildItem - Path $ciFolderPath - Filter " ci*.yml" - File)
121+ $ciFiles = @ ()
122+
123+ # if this path exists, then we should look in it for the ci.yml files and return nothing if nothing is found
124+ if (Test-Path $ciFolderPath ){
125+ $ciFiles = @ (Get-ChildItem - Path $ciFolderPath - Filter " ci*.yml" - File)
126+ }
127+ # if not, we should at least try to resolve the eng/ folder to fall back and see if that's where the path exists
128+ else {
129+ $ciFolderPath = Join-Path - Path $RepoRoot - ChildPath (Join-Path " eng" $this.ServiceDirectory )
130+ if (Test-Path $ciFolderPath ) {
131+ $ciFiles = @ (Get-ChildItem - Path $ciFolderPath - Filter " ci*.yml" - File)
132+ }
133+ }
134+
135+ return $ciFiles
136+ }
137+
138+ [PSCustomObject ]GetCIYmlForArtifact() {
139+ $ciFiles = @ ($this.ResolveCIFolderPath ())
123140 $ciArtifactResult = $null
124141 $soleCIYml = ($ciFiles.Count -eq 1 )
125142
You can’t perform that action at this time.
0 commit comments