From 50c745ac31e6f7dfc0d07096d61b67b42536fe41 Mon Sep 17 00:00:00 2001 From: "deniz_irgin@yahoo.com" Date: Mon, 27 May 2019 03:09:46 +0300 Subject: [PATCH] * Refactor some code --- src/LocalStack.AwsLocal/{ => Docs}/Usage.txt | 0 src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj | 9 +++++---- src/LocalStack.AwsLocal/Program.cs | 11 +++++------ 3 files changed, 10 insertions(+), 10 deletions(-) rename src/LocalStack.AwsLocal/{ => Docs}/Usage.txt (100%) diff --git a/src/LocalStack.AwsLocal/Usage.txt b/src/LocalStack.AwsLocal/Docs/Usage.txt similarity index 100% rename from src/LocalStack.AwsLocal/Usage.txt rename to src/LocalStack.AwsLocal/Docs/Usage.txt diff --git a/src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj b/src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj index 049cd07..3523c66 100644 --- a/src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj +++ b/src/LocalStack.AwsLocal/LocalStack.AwsLocal.csproj @@ -7,6 +7,10 @@ true + + + + @@ -17,11 +21,8 @@ + - - - - \ No newline at end of file diff --git a/src/LocalStack.AwsLocal/Program.cs b/src/LocalStack.AwsLocal/Program.cs index a598af9..a4ad907 100644 --- a/src/LocalStack.AwsLocal/Program.cs +++ b/src/LocalStack.AwsLocal/Program.cs @@ -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"); @@ -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); @@ -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") @@ -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()