This commit is contained in:
2025-08-21 15:51:05 -04:00
parent 4e4d867895
commit 592301d1f8
28 changed files with 201 additions and 161 deletions

View File

@@ -6,9 +6,44 @@
* <https://opensource.org/licence/bsd-3-clause>
*/
#include <unistd.h>
#include <stdio.h>
#include "../include/yait.h"
#include "contents.h"
char buffer[BUFSIZ];
int create_project(manifest_t manifest)
{
mkdir_p(manifest.project);
chdir(manifest.project);
if (manifest.flags.simple) {
cfprintf(
"Makefile",
".POSIX:\nCC ::= gcc\nCFLAGS ::= -Wall --std=c23 -Wpedantic\n\nall: %s",
manifest.project);
cfprintf("README", "%s", manifest.project);
snprintf(buffer, BUFSIZ, "%s.c", manifest.project);
cfprintf(buffer, "");
return 0;
}
cfprintf("Makefile", "");
cfprintf("configure", configure);
cfprintf(".clang-format", "");
cfprintf("README", readme, manifest.name);
cfprintf("src/main.c", "");
snprintf(buffer, BUFSIZ, "include/%s.h", manifest.project);
cfprintf(buffer, "");
snprintf(buffer, BUFSIZ, "man/%s.1", manifest.project);
cfprintf(buffer, "");
cfprintf("doc/WHATNEXT", what_next);
return 0;
}