diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-30 14:01:59 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-30 14:01:59 +0530 |
commit | f57f335603a13c70168b1f46332a8827c32477b2 (patch) | |
tree | 06fe50976f3f72b3bcc063ec8f91156d6c08e003 /src/msg.c | |
parent | 9aba370924df4c471b8527f08d2c60cacb8989d9 (diff) |
msg: get output directory from getopt
Diffstat (limited to 'src/msg.c')
-rw-r--r-- | src/msg.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -49,9 +49,13 @@ handle_file(const char *path) char *dot = strrchr(inpath, '.'); if (dot && strcmp(dot, ".md") == 0) { - asprintf(&outpath, "%s/%.*s.html", OUTPUT, (int) strlen(path) - 3, path); + asprintf(&outpath, + "%s/%.*s.html", + msg->output_directory, + (int) strlen(path) - 3, + path); } else { - asprintf(&outpath, "%s/%s", OUTPUT, path); + asprintf(&outpath, "%s/%s", msg->output_directory, path); } char *temp_outpath = strdup(outpath); @@ -118,7 +122,7 @@ run(void) base_template = template_create(); - int err = mkdir(OUTPUT, 0700); + int err = mkdir(msg->output_directory, 0700); if (err != 0 && errno != EEXIST) { perror("mkdir"); return EXIT_FAILURE; |