Skip to content

Commit d7155ed

Browse files
authored
Update psci.psm1 (#21276)
1 parent 3040e77 commit d7155ed

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tools/SwaggerCI/psci.psm1

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function Invoke-SwaggerCI {
1414

1515
# region Phase 1
1616
foreach ($rd in $config.relatedReadmeMdFiles) {
17-
$moduleName = $rd.split("/")[1]
17+
$moduleName = $rd.split("/")[1] + ".DefaultTag"
1818
# Set moduleName to modulePath at first
1919
$rdFolder = Join-Path $config.specFolder (Split-Path $rd -Parent)
2020
$rdPath = Join-Path $rdFolder "readme.md"
@@ -92,16 +92,19 @@ function Build-Module {
9292
#Package
9393
$Null = . (Join-Path $moduleFolder "pack-module.ps1")
9494

95-
$moduleName = (Get-ChildItem -Path $moduleFolder -Recurse -Filter "*.nupkg").Name.Split('.')[1]
95+
$package = Get-ChildItem -Path $moduleFolder -Recurse -Filter "*.nupkg"
96+
$packageName = $package.Name
97+
$packagePath = Split-Path $package.FullName -Parent
98+
$packageFolder = [System.IO.Path]::GetRelativePath((Get-Location), $packagePath)
9699

97100
#Generate result
98-
$downloadUrl = $config.installInstructionInput.downloadUrlPrefix + "Az.$moduleName/Az.$moduleName.0.1.0.nupkg"
99-
$downloadCmd = "curl -L $downloadUrl -o Az.$moduleName.0.1.0.nupkg"
101+
$downloadUrl = $config.installInstructionInput.downloadUrlPrefix + "Az.$moduleName/$packageName"
102+
$downloadCmd = "curl -L $downloadUrl -o $packageName"
100103
$package = @{
101104
packageName = "Az.$moduleName"
102-
path = @("swaggerci/$moduleName")
105+
path = @([System.IO.Path]::GetRelativePath((Get-Location), $moduleFolder))
103106
readmeMd = @($rd)
104-
artifacts = @("swaggerci/$moduleName/bin/Az.$moduleName.0.1.0.nupkg")
107+
artifacts = @("$packageFolder/$packageName")
105108
installInstructions = @{full = "Please download the package through the curl command '$downloadCmd', and then you could have a try locally."}
106109
result = "succeeded"
107110
}

0 commit comments

Comments
 (0)