From f444697d93244425fa799023d0e7adf80ecaa1de Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Wed, 4 Feb 2026 11:38:05 -0800 Subject: [PATCH] use exe name as the default if nothing else provided --- lambdabuild.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lambdabuild.zig b/lambdabuild.zig index 8aedce3..e3a6f79 100644 --- a/lambdabuild.zig +++ b/lambdabuild.zig @@ -11,8 +11,8 @@ const std = @import("std"); /// via command-line options (e.g., `-Dfunction-name=...`). pub const Config = struct { /// Default function name if not specified via -Dfunction-name. - /// This allows consuming projects to set their own default. - default_function_name: []const u8 = "zig-fn", + /// If null, falls back to the executable name (exe.name). + default_function_name: ?[]const u8 = null, /// Default IAM role name if not specified via -Drole-name. default_role_name: []const u8 = "lambda_basic_execution", @@ -75,7 +75,7 @@ pub fn configureBuild( const cli = lambda_build_dep.artifact("lambda-build"); // Get configuration options (command-line overrides config defaults) - const function_name = b.option([]const u8, "function-name", "Function name for Lambda") orelse config.default_function_name; + const function_name = b.option([]const u8, "function-name", "Function name for Lambda") orelse config.default_function_name orelse exe.name; const region = b.option([]const u8, "region", "AWS region") orelse null; const profile = b.option([]const u8, "profile", "AWS profile") orelse null; const role_name = b.option(