forked from dotnet/interactive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
repack.ps1
33 lines (27 loc) · 1.01 KB
/
repack.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
28
29
30
31
32
33
Push-Location $PSScriptRoot
try
{
# clean up the previously-cached NuGet packages
Remove-Item -Recurse ~\.nuget\packages\microsoft.dotnet.interactive* -Force
# build and pack dotnet-interactive
dotnet clean -c debug
dotnet build -c debug
dotnet pack -c debug /p:PackageVersion=2.0.0
# copy the dotnet-interactive packages to the temp directory
$destinationPath = "C:\temp\packages"
if (-not (Test-Path -Path $destinationPath -PathType Container)) {
New-Item -Path $destinationPath -ItemType Directory -Force
}
Get-ChildItem -Recurse -Filter *.nupkg | Move-Item -Destination $destinationPath -Force
# delete the #r nuget caches
if (Test-Path -Path ~\.packagemanagement\nuget\Cache -PathType Container) {
Remove-Item -Recurse -Force ~\.packagemanagement\nuget\Cache
}
if (Test-Path -Path ~\.packagemanagement\nuget\Projects -PathType Container) {
Remove-Item -Recurse -Force ~\.packagemanagement\nuget\Projects
}
}
finally
{
$PopLocation
}