From 7eadd2e6e56d9eae9cce1ddd5ec289ad0bb1cf39 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Mon, 18 Sep 2023 14:49:29 -0700 Subject: [PATCH] base deployment decision on packaged zip --- src/lambdabuild.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lambdabuild.zig b/src/lambdabuild.zig index 062c160..b3f1780 100644 --- a/src/lambdabuild.zig +++ b/src/lambdabuild.zig @@ -140,7 +140,7 @@ pub fn configureBuild(b: *std.build.Builder, exe: *std.Build.Step.Compile) !void // Amazon Linux 2 is the only arm64 supported option // TODO: This should determine compilation target and use x86_64 if needed const not_found = "aws lambda create-function --architectures arm64 --runtime provided.al2 --function-name {s} --zip-file fileb://{s} --handler not_applicable {s} && touch {s}"; - const not_found_fmt = try std.fmt.allocPrint(b.allocator, not_found, .{ function_name, function_zip, iam_role, function_name_file }); + const not_found_fmt = try std.fmt.allocPrint(b.allocator, not_found, .{ function_name, function_zip, iam_role_param, function_name_file }); defer b.allocator.free(not_found_fmt); const found = "aws lambda update-function-code --function-name {s} --zip-file fileb://{s} && touch {s}"; const found_fmt = try std.fmt.allocPrint(b.allocator, found, .{ function_name, function_zip, function_name_file }); @@ -156,7 +156,7 @@ pub fn configureBuild(b: *std.build.Builder, exe: *std.Build.Step.Compile) !void } const cmd = try std.fmt.allocPrint(b.allocator, ifstatement, .{ function_name_file, - std.fs.path.dirname(exe.root_src.?.path).?, + b.getInstallPath(.bin, "function.zip"), function_name_file, function_name, not_found_fmt,