File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 11testResults.xml
2+ temp
Original file line number Diff line number Diff line change 1+ Describe ' Publishing' {
2+ It ' Test-ModuleManifest' {
3+ Test-ModuleManifest - Path " $PSScriptRoot /../modules/Sentry/Sentry.psd1" - Verbose
4+ }
5+
6+ It ' Publish-Module' {
7+ $tempModuleDir = " $PSScriptRoot /temp/Sentry"
8+ Remove-Item $tempModuleDir - Recurse - ErrorAction SilentlyContinue
9+ Copy-Item " $PSScriptRoot /../modules/Sentry" - Destination $tempModuleDir - Recurse
10+
11+ # Update version in the module manifest
12+ $content = Get-Content " $tempModuleDir /Sentry.psd1"
13+ $changes = 0
14+ for ($i = 0 ; $i -lt $content.Length ; $i ++ )
15+ {
16+ if ($content [$i ] -match " ^(\s*ModuleVersion\s*=\s*)'[^']*'\s*$" )
17+ {
18+ $content [$i ] = $matches [1 ] + " '9.9.9'"
19+ $changes ++
20+ }
21+ if ($content [$i ] -match " ^(\s*Prerelease\s*=\s*)'[^']*'\s*$" )
22+ {
23+ $content [$i ] = $matches [1 ] + " 'test'"
24+ $changes ++
25+ }
26+ }
27+ $changes | Should - Be 2
28+ $content | Out-File " $tempModuleDir /Sentry.psd1"
29+
30+ Publish-Module - Path $tempModuleDir - NuGetApiKey ' test' - Verbose - WhatIf
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments