Skip to content

Commit 9d582af

Browse files
committed
ensure output dir is existing
1 parent c5d0593 commit 9d582af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

chatu.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@
334334
;; ~ is after `shell-quote-argument' is \~, which is not
335335
;; working. remove it.
336336
(script (string-replace "\\~" "~" script))
337-
(result (plist-get keyword-plist :output-path)))
337+
(result (plist-get keyword-plist :output-path))
338+
(result-dir (file-name-directory result)))
339+
;; ensure output-dir exists.
340+
(when (not (file-exists-p result-dir))
341+
(make-directory result-dir t))
338342
(forward-line)
339343
(chatu-skip-lines)
340344
(let ((process (start-process-shell-command "chatu-buffer" nil script)))

0 commit comments

Comments
 (0)