Skip to content

Commit

Permalink
Merge pull request #4 from localstack-dotnet/fix-unable-to-find-aws-cli
Browse files Browse the repository at this point in the history
fix aws executable path problem for new aws cli versions. fixes #3
  • Loading branch information
Blind-Striker authored Mar 11, 2021
2 parents 152dcea + 1158149 commit 98c055c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/LocalStack.AwsLocal/CommandDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,16 @@ public void Run()

processSettings.Arguments = builder;

string awsExec = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "aws.cmd" : "aws";
string[] awsExec = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
? new[] {"aws.exe", "aws.cmd"}
: new[] {"aws"};

FilePath? awsPath = GetAwsPath(awsExec);

if (awsPath == null)
{
ConsoleContext.Current.WriteLine($"ERROR: Unable to find aws cli");
ConsoleContext.Current.WriteLine(
$"ERROR: Unable to find aws cli. Executable name: {string.Join(',', awsExec)}");
EnvironmentContext.Current.Exit(1);
return;
}
Expand Down

0 comments on commit 98c055c

Please sign in to comment.