Skip to content

Commit

Permalink
* Refactor some code
Browse files Browse the repository at this point in the history
  • Loading branch information
Blind-Striker committed May 27, 2019
1 parent f378ec4 commit 50c745a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
File renamed without changes.
9 changes: 5 additions & 4 deletions src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<PackAsTool>true</PackAsTool>
</PropertyGroup>

<ItemGroup>
<None Remove="Docs\Usage.txt" />
</ItemGroup>

<ItemGroup>
<Folder Include="Depedencies\Contracts\" />
<Folder Include="Depedencies\Models\" />
Expand All @@ -17,11 +21,8 @@
<Compile Include="..\..\depedencies\localstack-dotnet-client\src\LocalStack.Client\Enums\AwsServiceEndpointMetadata.cs" Link="Depedencies\Enums\AwsServiceEndpointMetadata.cs" />
<Compile Include="..\..\depedencies\localstack-dotnet-client\src\LocalStack.Client\Enums\AwsServiceEnum.cs" Link="Depedencies\Enums\AwsServiceEnum.cs" />
<Compile Include="..\..\depedencies\localstack-dotnet-client\src\LocalStack.Client\Models\AwsServiceEndpoint.cs" Link="Depedencies\Models\AwsServiceEndpoint.cs" />
<EmbeddedResource Include="Docs\Usage.txt" />

<None Include="..\..\depedencies\README.md" Link="Depedencies\README.md" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Usage.txt" />
</ItemGroup>
</Project>
11 changes: 5 additions & 6 deletions src/LocalStack.AwsLocal/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace LocalStack.AwsLocal
{
internal static class Program
{
private const string UsageResource = "LocalStack.AwsLocal.Usage.txt";
private const string UsageResource = "LocalStack.AwsLocal.Docs.Usage.txt";

private static readonly IProcessHelper ProcessHelper = new ProcessHelper();
private static readonly string LocalStackHost = Environment.GetEnvironmentVariable("LOCALSTACK_HOST");
Expand All @@ -29,10 +29,9 @@ private static void Main(string[] args)
Usage();
}

AwsServiceEndpoint awsServiceEndpoint = GetServiceEndpoint();
string service = GetService();
(string service, AwsServiceEndpoint awsServiceEndpoint) = GetServiceEndpoint();

if (awsServiceEndpoint == null || service == null)
if (awsServiceEndpoint == null)
{
Console.WriteLine($"ERROR: Unable to find LocalStack endpoint for service {service}");
Environment.Exit(1);
Expand Down Expand Up @@ -72,7 +71,7 @@ private static string GetService()
return string.Empty;
}

private static AwsServiceEndpoint GetServiceEndpoint()
private static (string service, AwsServiceEndpoint awsServiceEndpoint) GetServiceEndpoint()
{
string service = GetService();
if (service == "s3api")
Expand All @@ -81,7 +80,7 @@ private static AwsServiceEndpoint GetServiceEndpoint()
}

var awsServiceEndpoints = Config.GetAwsServiceEndpoints();
return awsServiceEndpoints.SingleOrDefault(endpoint => endpoint.CliName == service);
return (service, awsServiceEndpoints.SingleOrDefault(endpoint => endpoint.CliName == service));
}

private static void Usage()
Expand Down

0 comments on commit 50c745a

Please sign in to comment.