Skip to content

Commit

Permalink
emm
Browse files Browse the repository at this point in the history
  • Loading branch information
littlewhitecloud authored Dec 9, 2023
1 parent b709670 commit 8a056d9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#endif

#include "jou_compiler.h"
#include <unistd.h>
#include <libgen.h>
#include <stdarg.h>
#include <errno.h>
Expand Down Expand Up @@ -103,6 +104,16 @@ static void mkdir_exist_ok(const char *p)
exit(1);
}

static void write_gitinore(const char *p)
{
char *filename = malloc_sprintf("%s/.gitinore", p);
if (access(filename, F_OK))
return;
FILE *gitinore = fopen(filename, "w");
fprintf(gitinore, "*");
fclose(gitinore);
}

static char *get_path_to_file_in_jou_compiled(const char *filename)
{
/*
Expand All @@ -120,6 +131,7 @@ static char *get_path_to_file_in_jou_compiled(const char *filename)

// path1 is known to exist
mkdir_exist_ok(path2);
write_gitinore(path2);
mkdir_exist_ok(path3);
free(path1);
free(path2);
Expand Down

0 comments on commit 8a056d9

Please sign in to comment.