diff options
author | Arun Isaac | 2020-07-09 03:11:09 +0530 |
---|---|---|
committer | Arun Isaac | 2020-07-09 03:11:09 +0530 |
commit | 26f4d41cf1ea84bb2f4f23c52ffc62ef3b7add12 (patch) | |
tree | 2bb4326c2393e5f844952529fa1f67b68edaaa01 /ennu.el | |
parent | 64b2350163d95cb0baa311914a6aa246201d4dc4 (diff) | |
download | ennum-26f4d41cf1ea84bb2f4f23c52ffc62ef3b7add12.tar.gz ennum-26f4d41cf1ea84bb2f4f23c52ffc62ef3b7add12.tar.lz ennum-26f4d41cf1ea84bb2f4f23c52ffc62ef3b7add12.zip |
Do not create tangle output in :posts-directory.
An ennu-operation should not write anything in the input
directories. Doing so is a recipe for data loss.
* ennu.el (ennu-publish-post): Do not create tangle output in
:posts-directory.
Diffstat (limited to 'ennu.el')
-rw-r--r-- | ennu.el | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -132,9 +132,15 @@ last form in BODY." (ennu-setting :static-directory))) (ennu-post-tangle post)) :publish (lambda (&rest output-files) - (org-babel-tangle-publish - nil (ennu-post-filename post) - (file-name-directory (first output-files))))))) + ;; TODO: Handle tangle outputs that are nested + ;; into directories, and when each tangle output + ;; is nested into a different directory. + (let ((post-file-copy (concat + (file-name-directory (first output-files)) + (file-name-nondirectory (ennu-post-filename post))))) + (copy-file (ennu-post-filename post) post-file-copy) + (org-babel-tangle-file post-file-copy) + (delete-file post-file-copy)))))) posts) link-publish-operations))) |