File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
test/PublishPSResourceTests Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -543,7 +543,10 @@ private string CreateNuspec(
543
543
{
544
544
if ( psData . ContainsKey ( "prerelease" ) && psData [ "prerelease" ] is string preReleaseVersion )
545
545
{
546
- version = string . Format ( @"{0}-{1}" , version , preReleaseVersion ) ;
546
+ if ( ! string . IsNullOrEmpty ( preReleaseVersion ) )
547
+ {
548
+ version = string . Format ( @"{0}-{1}" , version , preReleaseVersion ) ;
549
+ }
547
550
}
548
551
549
552
if ( psData . ContainsKey ( "licenseuri" ) && psData [ "licenseuri" ] is string licenseUri )
Original file line number Diff line number Diff line change @@ -392,6 +392,18 @@ Describe "Test Publish-PSResource" -tags 'CI' {
392
392
(Get-ChildItem $script :destinationPath ).FullName | Should - Be $expectedPath
393
393
}
394
394
395
+ It " Publish a module with -Path -Repository and -DestinationPath" {
396
+ $moduleName = " Pester"
397
+ $moduleVersion = " 5.5.0"
398
+ Save-PSResource - Name $moduleName - Path $tmpRepoPath - Version $moduleVersion - Repository PSGallery - TrustRepository
399
+ $modulePath = Join-Path - Path $tmpRepoPath - ChildPath $moduleName
400
+ $moduleVersionPath = Join-Path - Path $modulePath - ChildPath $moduleVersion
401
+ $moduleManifestPath = Join-path - Path $moduleVersionPath - ChildPath " $moduleName .psd1"
402
+ Publish-PSResource - Path $moduleManifestPath - Repository $testRepository2
403
+ $expectedPath = Join-Path - Path $script :repositoryPath2 - ChildPath " $moduleName .$moduleVersion .nupkg"
404
+ (Get-ChildItem $script :repositoryPath2 ).FullName | Should - Be $expectedPath
405
+ }
406
+
395
407
It " Publish a module and clean up properly when file in module is readonly" {
396
408
$version = " 1.0.0"
397
409
New-ModuleManifest - Path (Join-Path - Path $script :PublishModuleBase - ChildPath " $script :PublishModuleName .psd1" ) - ModuleVersion $version - Description " $script :PublishModuleName module"
You can’t perform that action at this time.
0 commit comments