29 lines
750 B
Plaintext
29 lines
750 B
Plaintext
@{/*
|
|
|
|
nuget-packages-add
|
|
Installs packages to a NuGet v3 directory structure
|
|
|
|
sourcePackagesDir=''
|
|
Required. Path to packages to install (skips symbol packages)
|
|
|
|
targetPackagesDir=''
|
|
Optional. Path to publish packages.
|
|
*/}
|
|
|
|
default targetPackagesDir=''
|
|
|
|
@{
|
|
var packages = Directory.EnumerateFiles(sourcePackagesDir, "*.nupkg")
|
|
.Where(p => !p.EndsWith(".symbols.nupkg"));
|
|
|
|
var nugetExePath = Environment.GetEnvironmentVariable("PUSH_NUGET_EXE");
|
|
if (string.IsNullOrEmpty(nugetExePath))
|
|
{
|
|
nugetExePath = ".build/NuGet.exe";
|
|
}
|
|
|
|
Parallel.ForEach(packages, package =>
|
|
{
|
|
ExecClr(nugetExePath, "add " + package + " -source " + targetPackagesDir + " -expand");
|
|
});
|
|
} |