Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

Commit 50c745a

Browse files
committed
* Refactor some code
1 parent f378ec4 commit 50c745a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed
File renamed without changes.

src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
<PackAsTool>true</PackAsTool>
88
</PropertyGroup>
99

10+
<ItemGroup>
11+
<None Remove="Docs\Usage.txt" />
12+
</ItemGroup>
13+
1014
<ItemGroup>
1115
<Folder Include="Depedencies\Contracts\" />
1216
<Folder Include="Depedencies\Models\" />
@@ -17,11 +21,8 @@
1721
<Compile Include="..\..\depedencies\localstack-dotnet-client\src\LocalStack.Client\Enums\AwsServiceEndpointMetadata.cs" Link="Depedencies\Enums\AwsServiceEndpointMetadata.cs" />
1822
<Compile Include="..\..\depedencies\localstack-dotnet-client\src\LocalStack.Client\Enums\AwsServiceEnum.cs" Link="Depedencies\Enums\AwsServiceEnum.cs" />
1923
<Compile Include="..\..\depedencies\localstack-dotnet-client\src\LocalStack.Client\Models\AwsServiceEndpoint.cs" Link="Depedencies\Models\AwsServiceEndpoint.cs" />
24+
<EmbeddedResource Include="Docs\Usage.txt" />
2025

2126
<None Include="..\..\depedencies\README.md" Link="Depedencies\README.md" />
2227
</ItemGroup>
23-
24-
<ItemGroup>
25-
<EmbeddedResource Include="Usage.txt" />
26-
</ItemGroup>
2728
</Project>

src/LocalStack.AwsLocal/Program.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace LocalStack.AwsLocal
1212
{
1313
internal static class Program
1414
{
15-
private const string UsageResource = "LocalStack.AwsLocal.Usage.txt";
15+
private const string UsageResource = "LocalStack.AwsLocal.Docs.Usage.txt";
1616

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

32-
AwsServiceEndpoint awsServiceEndpoint = GetServiceEndpoint();
33-
string service = GetService();
32+
(string service, AwsServiceEndpoint awsServiceEndpoint) = GetServiceEndpoint();
3433

35-
if (awsServiceEndpoint == null || service == null)
34+
if (awsServiceEndpoint == null)
3635
{
3736
Console.WriteLine($"ERROR: Unable to find LocalStack endpoint for service {service}");
3837
Environment.Exit(1);
@@ -72,7 +71,7 @@ private static string GetService()
7271
return string.Empty;
7372
}
7473

75-
private static AwsServiceEndpoint GetServiceEndpoint()
74+
private static (string service, AwsServiceEndpoint awsServiceEndpoint) GetServiceEndpoint()
7675
{
7776
string service = GetService();
7877
if (service == "s3api")
@@ -81,7 +80,7 @@ private static AwsServiceEndpoint GetServiceEndpoint()
8180
}
8281

8382
var awsServiceEndpoints = Config.GetAwsServiceEndpoints();
84-
return awsServiceEndpoints.SingleOrDefault(endpoint => endpoint.CliName == service);
83+
return (service, awsServiceEndpoints.SingleOrDefault(endpoint => endpoint.CliName == service));
8584
}
8685

8786
private static void Usage()

0 commit comments

Comments
 (0)