From defb396ee51c80d2df1c7bbc58dbefd0c6a0b165 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Thu, 26 Jul 2018 22:23:30 +0200 Subject: make: added atom_dump helper rule --- src/blogc-make/rules.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/blogc-make/rules.c') diff --git a/src/blogc-make/rules.c b/src/blogc-make/rules.c index 9d599cc..d95edd8 100644 --- a/src/blogc-make/rules.c +++ b/src/blogc-make/rules.c @@ -13,6 +13,7 @@ #include #include #include "../common/utils.h" +#include "atom.h" #include "ctx.h" #include "exec.h" #include "exec-native.h" @@ -626,6 +627,20 @@ watch_exec(bm_ctx_t *ctx, bc_slist_t *outputs, bc_trie_t *args) } +// ATOM DUMP RULE + +static int +atom_dump_exec(bm_ctx_t *ctx, bc_slist_t *outputs, bc_trie_t *args) +{ + char *content = bm_atom_generate(ctx->settings); + if (content == NULL) + return 3; + printf("%s", content); + free(content); + return 0; +} + + const bm_rule_t rules[] = { { .name = "all", @@ -713,6 +728,13 @@ const bm_rule_t rules[] = { .exec_func = watch_exec, .generate_files = false, }, + { + .name = "atom_dump", + .help = "dump default Atom feed template based on current settings", + .outputlist_func = NULL, + .exec_func = atom_dump_exec, + .generate_files = false, + }, {NULL, NULL, NULL, NULL, false}, }; -- cgit v1.2.3-18-g5258