Skip to content

Commit

Permalink
Auto create dir for config output
Browse files Browse the repository at this point in the history
  • Loading branch information
Moe-hacker committed Dec 22, 2024
1 parent 147cece commit abedc35
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ruri.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,8 @@ static void parse_args(int argc, char **_Nonnull argv, struct RURI_CONTAINER *_N
}
unlink(output_path);
remove(output_path);
ruri_mkdirs(output_path, 0755);
rmdir(output_path);
int fd = open(output_path, O_CREAT | O_CLOEXEC | O_RDWR, S_IRUSR | S_IRGRP | S_IROTH | S_IWGRP | S_IWUSR | S_IWOTH);
if (fd < 0) {
ruri_error("{red}Error: failed to open output file QwQ\n");
Expand Down

0 comments on commit abedc35

Please sign in to comment.