Merge Nuget changes

Fix pack
Move dotnet-nuget to NuGetForwardingApp [tests will need to be fixed]
This commit is contained in:
PiotrP 2016-08-26 17:23:33 -07:00
parent ed66c70106
commit 336ecc0e89
7 changed files with 28 additions and 87 deletions

View file

@ -0,0 +1,42 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.DotNet.Cli;
namespace Microsoft.DotNet.Tools
{
public class NuGetForwardingApp
{
private const string s_nugetExeName = "NuGet.CommandLine.XPlat.dll";
private readonly ForwardingApp _forwardingApp;
public NuGetForwardingApp(IEnumerable<string> argsToForward)
{
_forwardingApp = new ForwardingApp(
GetNuGetExePath(),
argsToForward);
}
public int Execute()
{
return _forwardingApp.Execute();
}
public NuGetForwardingApp WithEnvironmentVariable(string name, string value)
{
_forwardingApp.WithEnvironmentVariable(name, value);
return this;
}
private static string GetNuGetExePath()
{
return Path.Combine(
AppContext.BaseDirectory,
s_nugetExeName);
}
}
}