diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-05-31 02:52:43 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-05-31 02:52:43 +0200 |
commit | 4ab4c1d0ba31d437e05792719fba664a94521819 (patch) | |
tree | 953bf2925e1c96f95be28132a5459b82bd5a51bf /src/blogc-git-receiver/settings.c | |
parent | 56e07b6224fce7e213bfb9b4d00b93628a50aca7 (diff) | |
download | blogc-4ab4c1d0ba31d437e05792719fba664a94521819.tar.gz blogc-4ab4c1d0ba31d437e05792719fba664a94521819.tar.bz2 blogc-4ab4c1d0ba31d437e05792719fba664a94521819.zip |
git-receiver: allow users to define builds dir
Diffstat (limited to 'src/blogc-git-receiver/settings.c')
-rw-r--r-- | src/blogc-git-receiver/settings.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/blogc-git-receiver/settings.c b/src/blogc-git-receiver/settings.c index 514fcdf..4cfcaf7 100644 --- a/src/blogc-git-receiver/settings.c +++ b/src/blogc-git-receiver/settings.c @@ -20,9 +20,9 @@ const char* -bgr_settings_get_basedir(void) +bgr_settings_get_base_dir(void) { - char *rv = getenv("BLOGC_GIT_RECEIVER_BASEDIR"); + char *rv = getenv("BLOGC_GIT_RECEIVER_BASE_DIR"); if (rv != NULL) { return rv; } @@ -31,9 +31,20 @@ bgr_settings_get_basedir(void) char* +bgr_settings_get_builds_dir(void) +{ + char *rv = getenv("BLOGC_GIT_RECEIVER_BUILDS_DIR"); + if (rv != NULL) { + return bc_strdup(rv); + } + return bc_strdup_printf("%s/builds", bgr_settings_get_base_dir()); +} + + +char* bgr_settings_get_section(bc_config_t *config, const char *repo_path) { - const char *bd = bgr_settings_get_basedir(); + const char *bd = bgr_settings_get_base_dir(); if (bd == NULL) { return NULL; } @@ -62,7 +73,7 @@ bgr_settings_get_section(bc_config_t *config, const char *repo_path) bc_config_t* bgr_settings_parse(void) { - const char *bd = bgr_settings_get_basedir(); + const char *bd = bgr_settings_get_base_dir(); if (bd == NULL) { return NULL; } |