append ".wasm" to the compile exe name for Cloudflare
All checks were successful
AWS-Zig Build / build-zig-0.11.0-amd64-host (push) Successful in 1m23s

This commit is contained in:
Emil Lerch 2023-10-20 22:54:08 -07:00
parent e7a6aa5f04
commit 70b0fda03b
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -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, "."),
},