Merge pull request #4272 from brthor/brthor/tools-fix

Fix tools with trailing backslashes in additionalProbingPath
This commit is contained in:
Bryan Thornbury 2016-09-28 16:44:32 -07:00 committed by GitHub
commit 30e5ab7112
2 changed files with 7 additions and 2 deletions

View file

@ -4,6 +4,7 @@ using System.IO;
using System.Linq; using System.Linq;
using Microsoft.DotNet.InternalAbstractions; using Microsoft.DotNet.InternalAbstractions;
using Microsoft.DotNet.ProjectModel; using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.Tools.Common;
using NuGet.Frameworks; using NuGet.Frameworks;
using NuGet.ProjectModel; using NuGet.ProjectModel;
@ -94,13 +95,14 @@ namespace Microsoft.DotNet.Cli.Utils
} }
var toolLibrary = GetToolLibraryForContext(projectContext, commandName); var toolLibrary = GetToolLibraryForContext(projectContext, commandName);
var normalizedNugetPackagesRoot = PathUtility.EnsureNoTrailingDirectorySeparator(projectContext.PackagesDirectory);
return _packagedCommandSpecFactory.CreateCommandSpecFromLibrary( return _packagedCommandSpecFactory.CreateCommandSpecFromLibrary(
toolLibrary, toolLibrary,
commandName, commandName,
commandArguments, commandArguments,
allowedExtensions, allowedExtensions,
projectContext.PackagesDirectory, normalizedNugetPackagesRoot,
s_commandResolutionStrategy, s_commandResolutionStrategy,
depsFilePath, depsFilePath,
runtimeConfigPath); runtimeConfigPath);

View file

@ -4,6 +4,7 @@ using System.IO;
using System.Linq; using System.Linq;
using Microsoft.DotNet.InternalAbstractions; using Microsoft.DotNet.InternalAbstractions;
using Microsoft.DotNet.ProjectModel; using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.Tools.Common;
using Microsoft.Extensions.DependencyModel; using Microsoft.Extensions.DependencyModel;
using NuGet.Frameworks; using NuGet.Frameworks;
using NuGet.LibraryModel; using NuGet.LibraryModel;
@ -111,12 +112,14 @@ namespace Microsoft.DotNet.Cli.Utils
var depsFileRoot = Path.GetDirectoryName(lockFile.Path); var depsFileRoot = Path.GetDirectoryName(lockFile.Path);
var depsFilePath = GetToolDepsFilePath(toolLibraryRange, lockFile, depsFileRoot); var depsFilePath = GetToolDepsFilePath(toolLibraryRange, lockFile, depsFileRoot);
var normalizedNugetPackagesRoot = PathUtility.EnsureNoTrailingDirectorySeparator(nugetPackagesRoot);
return _packagedCommandSpecFactory.CreateCommandSpecFromLibrary( return _packagedCommandSpecFactory.CreateCommandSpecFromLibrary(
toolLibrary, toolLibrary,
commandName, commandName,
args, args,
_allowedCommandExtensions, _allowedCommandExtensions,
projectContext.PackagesDirectory, normalizedNugetPackagesRoot,
s_commandResolutionStrategy, s_commandResolutionStrategy,
depsFilePath, depsFilePath,
null); null);