-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrepareChocoPack.ps1
27 lines (27 loc) · 1.08 KB
/
PrepareChocoPack.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Copy-Item ./LICENSE.txt ./OctonautsCli/LICENSE.txt
$pkg = (Get-Item ./nuget_packages/*.nupkg).FullName
Remove-Item -Recurse -Force ./temp -ErrorAction SilentlyContinue
New-Item -Type Directory ./temp -ErrorAction SilentlyContinue
Copy-Item $pkg ./temp/temp.zip
Expand-Archive ./temp/temp.zip -DestinationPath ./temp
$content = Get-Content ./temp/OctonautsCli.nuspec -Raw
$meta = ([xml]$content).package.metadata
$projUrl = $meta.projectUrl
$replaceWith = @"
<title>$($meta.id)</title>
<owners>$($meta.authors)</owners>
<releaseNotes>$projUrl/releases</releaseNotes>
<packageSourceUrl>$projUrl</packageSourceUrl>
<bugTrackerUrl>$projUrl/issues</bugTrackerUrl>
<summary>$($meta.description)</summary>
</metadata>
<files>
<file src=".\publish\*.*" target="tools"/>
<file src="..\LICENSE.txt"/>
<file src=".\VERIFICATION.txt"/>
<file src=".\logo.png"/>
</files>
"@
$content = $content.Replace("</metadata>", $replaceWith)
$content = $content -replace "<id>.*</id>", "<id>$($meta.id.ToLower())</id>"
Set-Content ./OctonautsCli/OctonautsCli.nuspec $content