Separate placeholder for project and program names

This commit is contained in:
Casey 2024-05-29 12:31:12 +03:00
parent 37ff1782bb
commit 84b7493a4a
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
2 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
#include <raylib.h>
int main(int argc, char **argv) {
InitWindow(__WINDOW_WIDTH, __WINDOW_HEIGHT, "__PROGNAME");
InitWindow(__WINDOW_WIDTH, __WINDOW_HEIGHT, "__PROJECT_NAME");
while (!WindowShouldClose()) {
BeginDrawing();

3
new.py
View File

@ -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)