Browse Source

org-odt: Check for zip early during export

* contrib/lisp/org-odt.el (org-odt-init-outfile): Abort export
if zip utility is not available.
Jambunathan K 6 years ago
parent
commit
3e2057732a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      contrib/lisp/org-odt.el

+ 4 - 0
contrib/lisp/org-odt.el

@@ -1226,6 +1226,10 @@ MAY-INLINE-P allows inlining it as an image."
     (apply 'org-lparse-format-tags tag text prefix suffix args)))
 
 (defun org-odt-init-outfile (filename)
+  (unless (executable-find "zip")
+    ;; Not at all OSes ship with zip by default
+    (error "Executable \"zip\" needed for creating OpenDocument files. Aborting."))
+
   (let* ((outdir (make-temp-file org-export-odt-tmpdir-prefix t))
 	 (mimetype-file (expand-file-name "mimetype" outdir))
 	 (content-file (expand-file-name "content.xml" outdir))