diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-03-06 21:38:41 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-03-07 01:30:54 +0100 |
commit | d41c2fcdd9366fb3f1fcb11aceed919bfebbed61 (patch) | |
tree | 1081416126a9bff58857ade5984e5e3b9b45a487 /src/blogc-make/exec.c | |
parent | ab1120742467f887b33cd89addf3c89b5f9bf5b6 (diff) | |
download | blogc-d41c2fcdd9366fb3f1fcb11aceed919bfebbed61.tar.gz blogc-d41c2fcdd9366fb3f1fcb11aceed919bfebbed61.tar.bz2 blogc-d41c2fcdd9366fb3f1fcb11aceed919bfebbed61.zip |
make: add support to "production" builds
this is used by blogc-github-lambda and blogc-git-receiver.
Diffstat (limited to 'src/blogc-make/exec.c')
-rw-r--r-- | src/blogc-make/exec.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/blogc-make/exec.c b/src/blogc-make/exec.c index df028c2..db20cae 100644 --- a/src/blogc-make/exec.c +++ b/src/blogc-make/exec.c @@ -205,7 +205,7 @@ list_variables(const char *key, const char *value, bc_string_t *str) char* bm_exec_build_blogc_cmd(const char *blogc_bin, bm_settings_t *settings, bc_trie_t *variables, bool listing, const char *template, - const char *output, bool sources_stdin) + const char *output, bool production, bool sources_stdin) { bc_string_t *rv = bc_string_new(); @@ -228,6 +228,11 @@ bm_exec_build_blogc_cmd(const char *blogc_bin, bm_settings_t *settings, bc_trie_foreach(variables, (bc_trie_foreach_func_t) list_variables, rv); + if (production) { + bc_string_append(rv, + " -D MAKE_ENV_PRODUCTION=1 -D MAKE_ENV='production'"); + } + if (listing) { bc_string_append(rv, " -l"); } @@ -268,7 +273,7 @@ bm_exec_blogc(bm_ctx_t *ctx, bc_trie_t *variables, bool listing, } char *cmd = bm_exec_build_blogc_cmd(ctx->blogc, ctx->settings, variables, - listing, template->path, output->path, input->len > 0); + listing, template->path, output->path, ctx->production, input->len > 0); if (ctx->verbose) printf("%s\n", cmd); |