Skip to content

Commit

Permalink
fix appveyor/nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
genemars committed Jun 23, 2020
1 parent 7731d90 commit 1456c3a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions UPnP/nuget_pack.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
$project = "UPnP"
$root = (split-path -parent $MyInvocation.MyCommand.Definition) + '\..'
#$version = [System.Reflection.Assembly]::LoadFile("$root\$project\bin\Debug\$project.dll").GetName().Version

$versionStr = "{0}" -f ($env:APPVEYOR_REPO_TAG_NAME)

if (-not ([string]::IsNullOrEmpty($versionStr))) {
Write-Host "Setting $project .nuspec version tag to $versionStr"

$content = (Get-Content $root\$project\$project.nuspec)
$content = $content -replace '\$version\$',$versionStr

$content | Out-File $root\$project\$project.compiled.nuspec

& nuget pack $root\$project\$project.compiled.nuspec
}
else {
Write-Host "Version string is empty, possibly dry run or APPVEYOR_REPO_TAG_NAME environment variable is not set"
}

0 comments on commit 1456c3a

Please sign in to comment.