From 70b0fda03b9c54a6eda8d61cb8ab8b9d9f29b2ef Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Fri, 20 Oct 2023 22:54:08 -0700 Subject: [PATCH] append ".wasm" to the compile exe name for Cloudflare --- src/cloudflare_build.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cloudflare_build.zig b/src/cloudflare_build.zig index 2bf921d..fc4d9b1 100644 --- a/src/cloudflare_build.zig +++ b/src/cloudflare_build.zig @@ -5,6 +5,7 @@ const CloudflareDeployStep = @import("CloudflareDeployStep.zig"); const script = @embedFile("index.js"); pub fn configureBuild(b: *std.build.Builder, cs: *std.Build.Step.Compile, function_name: []const u8) !void { + const wasm_name = try std.fmt.allocPrint(b.allocator, "{s}.wasm", .{cs.name}); const deploy_cmd = CloudflareDeployStep.create( b, function_name, @@ -13,7 +14,7 @@ pub fn configureBuild(b: *std.build.Builder, cs: *std.Build.Step.Compile, functi .primary_file_data = script, .wasm_name = .{ .search = "custom.wasm", - .replace = cs.name, + .replace = wasm_name, }, .wasm_dir = b.getInstallPath(.bin, "."), },