mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-08 15:59:59 +00:00
build: rename Exercise.baseName to name
The name "baseName" is confusing, since it refers to the UNIX basename command, and not to the basename function in some programming languages including Zig. Use the std.fs.path.stem function to remove the file extension, instead of slicing. Remove the use of the assertion, since it is no longer necessary. Instead, add a check to ensure that the exercise must be a Zig source file in the validate_exercises function. Update the validate_exercises function to check the last exercise, too.
This commit is contained in:
@@ -323,7 +323,7 @@ fn heal(allocator: Allocator, exercises: []const Exercise, outdir: []const u8) !
|
||||
const patches_path = "patches/patches";
|
||||
|
||||
for (exercises) |ex| {
|
||||
const name = ex.baseName();
|
||||
const name = ex.name();
|
||||
|
||||
// Use the POSIX patch variant.
|
||||
const file = try join(allocator, &.{ exercises_path, ex.main_file });
|
||||
|
||||
Reference in New Issue
Block a user