From 84b7493a4aa4b3042ddf9858e0b68f348851511e Mon Sep 17 00:00:00 2001 From: hkc Date: Wed, 29 May 2024 12:31:12 +0300 Subject: [PATCH] Separate placeholder for project and program names --- _templates/raylib/empty/main.c | 2 +- new.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/_templates/raylib/empty/main.c b/_templates/raylib/empty/main.c index 2e6f06d..e79905d 100644 --- a/_templates/raylib/empty/main.c +++ b/_templates/raylib/empty/main.c @@ -1,7 +1,7 @@ #include int main(int argc, char **argv) { - InitWindow(__WINDOW_WIDTH, __WINDOW_HEIGHT, "__PROGNAME"); + InitWindow(__WINDOW_WIDTH, __WINDOW_HEIGHT, "__PROJECT_NAME"); while (!WindowShouldClose()) { BeginDrawing(); diff --git a/new.py b/new.py index c3d00a7..419ce55 100644 --- a/new.py +++ b/new.py @@ -79,7 +79,8 @@ for base, dirs, files in template.path.walk(): with in_path.open("r") as fp_in: with out_path.open("w") as fp_out: for line in fp_in: - line = line.replace("__PROGNAME", project_name) + line = line.replace("__PROGNAME", project_name.split("/")[-1]) + line = line.replace("__PROJECT", project_name) for param in template.parameters: line = line.replace(f"__{param}", parameters[param]) fp_out.write(line)