diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-02-25 22:43:51 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2020-01-12 12:37:11 +0100 |
commit | 7870e88f0653e6ac93c1f2e123aa9826778be376 (patch) | |
tree | 98d9c0840bf809ab5be36539680d0997762f3bb4 /src/blogc-make/exec-native.c | |
parent | a45e7255cb89d76c4836e1cac073c2f941529e70 (diff) | |
download | blogc-7870e88f0653e6ac93c1f2e123aa9826778be376.tar.gz blogc-7870e88f0653e6ac93c1f2e123aa9826778be376.tar.bz2 blogc-7870e88f0653e6ac93c1f2e123aa9826778be376.zip |
make: implemented optional sass support using libsassfeature/sass
pending:
- tests for sass support
- build tests on ci with and without libsass
- documentation
- support sass options in blogcfile
Diffstat (limited to 'src/blogc-make/exec-native.c')
-rw-r--r-- | src/blogc-make/exec-native.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/blogc-make/exec-native.c b/src/blogc-make/exec-native.c index 179216a..2417173 100644 --- a/src/blogc-make/exec-native.c +++ b/src/blogc-make/exec-native.c @@ -24,15 +24,9 @@ int -bm_exec_native_cp(bm_filectx_t *source, bm_filectx_t *dest, bool verbose) +bm_exec_native_mkdir_p(const char *filename) { - if (verbose) - printf("Copying '%s' to '%s'\n", source->path, dest->path); - else - printf(" COPY %s\n", dest->short_path); - fflush(stdout); - - char *fname = bc_strdup(dest->path); + char *fname = bc_strdup(filename); for (char *tmp = fname; *tmp != '\0'; tmp++) { if (*tmp != '/' && *tmp != '\\') continue; @@ -51,6 +45,23 @@ bm_exec_native_cp(bm_filectx_t *source, bm_filectx_t *dest, bool verbose) } free(fname); + return 0; +} + + +int +bm_exec_native_cp(bm_filectx_t *source, bm_filectx_t *dest, bool verbose) +{ + if (verbose) + printf("Copying '%s' to '%s'\n", source->path, dest->path); + else + printf(" COPY %s\n", dest->short_path); + fflush(stdout); + + int rv = bm_exec_native_mkdir_p(dest->path); + if (rv != 0) + return rv; + int fd_from = open(source->path, O_RDONLY); if (fd_from < 0) { fprintf(stderr, "blogc-make: error: failed to open source file to copy " |