This repository has been archived on 2025-09-07. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
dotnet-installer/src/Microsoft.DotNet.Cli.Utils/CommandResolution/PathCommandResolver.cs

30 lines
966 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.ProjectModel.Graph;
using Microsoft.Extensions.PlatformAbstractions;
using NuGet.Frameworks;
using NuGet.Packaging;
namespace Microsoft.DotNet.Cli.Utils
{
public class PathCommandResolver : AbstractPathBasedCommandResolver
{
public PathCommandResolver(IEnvironmentProvider environment,
IPlatformCommandSpecFactory commandSpecFactory) : base(environment, commandSpecFactory) { }
internal override string ResolveCommandPath(CommandResolverArguments commandResolverArguments)
{
return _environment.GetCommandPath(commandResolverArguments.CommandName);
}
internal override CommandResolutionStrategy GetCommandResolutionStrategy()
{
return CommandResolutionStrategy.Path;
}
}
}