Skip to content

Commit

Permalink
Merge branch 'convenience-improvements' of https://github.com/aidanjr…
Browse files Browse the repository at this point in the history
…yan/aws-lambda-dotnet into aidanjryan-convenience-improvements
  • Loading branch information
normj committed Feb 21, 2019
2 parents 23059f8 + d3565e5 commit 1ed4123
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Expand Up @@ -10,6 +10,7 @@ public class CommandLineOptions

public bool NoLaunchWindow { get; set; }

public string Path { get; set; }

public static CommandLineOptions Parse(string[] args)
{
Expand All @@ -27,6 +28,10 @@ public static CommandLineOptions Parse(string[] args)
options.NoLaunchWindow = GetNextBoolValue(i);
i++;
break;
case "--path":
options.Path = GetNextValue(i);
i++;
break;
}
}

Expand Down
9 changes: 4 additions & 5 deletions Tools/LambdaTestTool/Amazon.Lambda.TestTool/Program.cs
Expand Up @@ -29,14 +29,13 @@ static void Main(string[] args)
Port = commandOptions.Port
};

var path = Directory.GetCurrentDirectory();
var path = commandOptions.Path ?? Directory.GetCurrentDirectory();

// Check to see if running in debug mode from this project's directory which means the test tool is being debugged.
// Check to see if running in debug mode from this project's directory which means the test tool is being debugged.
// To make debugging easier pick one of the test Lambda projects.
if (Directory.GetCurrentDirectory().EndsWith("Amazon.Lambda.TestTool"))
if (path.EndsWith("Amazon.Lambda.TestTool"))
{
path = Path.Combine(Directory.GetCurrentDirectory(),
"../LambdaFunctions/S3EventFunction/bin/Debug/netcoreapp2.1");
path = Path.Combine(path, "../LambdaFunctions/S3EventFunction/bin/Debug/netcoreapp2.1");
}
// If running in the project directory select the build directory so the deps.json file can be found.
else if (Utils.IsProjectDirectory(path))
Expand Down
Expand Up @@ -18,6 +18,13 @@ public ExecutionResponse Execute(ExecutionRequest request)
{
var logger = new LocalLambdaLogger();
var response = new ExecutionResponse();

if (!string.IsNullOrEmpty(request.Function.ErrorMessage))
{
response.Error = request.Function.ErrorMessage;
return response;
}

try
{
if (!string.IsNullOrEmpty(request.AWSRegion))
Expand Down

0 comments on commit 1ed4123

Please sign in to comment.