-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpush.ps1
28 lines (20 loc) · 914 Bytes
/
push.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
param (
[string]$packageSource = "local-packages"
)
$project = "FakeXrmEasy.CodeActivities"
Write-Host "Running with packageSource '$($packageSource)' ..."
$dirSeparator = [IO.Path]::DirectorySeparatorChar
$tempNupkgFolder = ".$($dirSeparator)nupkgs$($dirSeparator)*.nupkg"
$localPackagesFolder = '../' + $packageSource
if($packageSource -eq "local-packages") {
$localPackagesFolder = '../' + $packageSource
Write-Host "Deleting previous pushed version '$($localPackagesFolder)'..."
$projectFilePattern = $project + ".*"
Get-ChildItem -Path $localPackagesFolder -Include $projectFilePattern -File -Recurse | ForEach-Object { $_.Delete()}
}
Write-Host "Pushing '$($project)' to source '$($packageSource)'..."
dotnet nuget push $tempNupkgFolder -s $packageSource
if(!($LASTEXITCODE -eq 0)) {
throw "Error pushing NuGet package"
}
Write-Host "Push Succeeded :)" -ForegroundColor Green