Last active
November 19, 2019 11:02
-
-
Save jesmaail/c8ffcbdd38faf3d78a369fbe80f04002 to your computer and use it in GitHub Desktop.
Rough local nuget dev script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"PackagesDirectory" : "", | |
"ProjectPath" : "", | |
"LocalNugetPath" : "" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to copy .nupkg files to local nuget repo and clear the associated packages folder | |
$ConfigFilePath = "localnugetupdate.json"; | |
function GetConfigValuesFromFile($path) | |
{ | |
$Config = Get-Content -Path $path -Raw| ConvertFrom-Json | |
$global:PackagesDirectory = $Config.PackagesDirectory | |
$global:ProjectPath = $Config.ProjectPath; | |
$global:LocalNugetPath = $Config.LocalNugetPath; | |
} | |
function CopyPackagesToFolder($source, $destination) | |
{ | |
# This needs refactoring | |
$ExclusionList = @("netstandard2.0") | |
$SourceFiles = $source + '/*'; | |
Copy-Item -Force $SourceFiles -Destination $destination -Exclude $ExclusionList | |
} | |
function DeleteFolder($path) | |
{ | |
Remove-Item -path $path -recurse | |
} | |
# Perform Steps | |
GetConfigValuesFromFile -path $ConfigFilePath | |
CopyPackagesToFolder -source $global:ProjectPath -destination $global:LocalNugetPath | |
DeleteFolder -path $global:PackagesDirectory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment