@@ -33,17 +33,17 @@ pub fn build(b: *Build) void {
3333 while (iterate .next ()) | val | {
3434 if (val ) | entry | {
3535 // get the entry name, entry can be file or directory
36- const name = entry .name ;
36+ const output_name = std . mem . trimRight ( u8 , entry .name , ".zig" ) ;
3737 if (entry .kind == .file ) {
3838 // connect path
39- const path = std .fs .path .join (b .allocator , &[_ ][]const u8 { relative_path , name }) catch | err | {
39+ const path = std .fs .path .join (b .allocator , &[_ ][]const u8 { relative_path , entry . name }) catch | err | {
4040 log .err ("fmt path for examples failed, err is {}" , .{err });
4141 std .os .exit (1 );
4242 };
4343
4444 // build exe
4545 const exe = b .addExecutable (.{
46- .name = name ,
46+ .name = output_name ,
4747 .root_source_file = .{ .path = path },
4848 .target = target ,
4949 .optimize = optimize ,
@@ -68,7 +68,7 @@ pub fn build(b: *Build) void {
6868 var child = ChildProcess .init (& args , b .allocator );
6969
7070 // build cwd
71- const cwd = std .fs .path .join (b .allocator , &[_ ][]const u8 { full_path , name }) catch | err | {
71+ const cwd = std .fs .path .join (b .allocator , &[_ ][]const u8 { full_path , entry . name }) catch | err | {
7272 log .err ("fmt path for examples failed, err is {}" , .{err });
7373 std .os .exit (1 );
7474 };
0 commit comments