~bzg/orgweb

741463f361c5888db12d7a3012f9d6bb61a55e29 — Bastien Guerry a month ago a892f8c
publish.sh: Add `orgweb-publish-stop-on-error'
1 files changed, 11 insertions(+), 4 deletions(-)

M publish.sh
M publish.sh => publish.sh +11 -4
@@ 1,7 1,12 @@
#!/usr/bin/env sh

":"; # -*- mode: emacs-lisp; lexical-binding: t; -*-
":"; exec emacs --quick --script "$0" -- "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-

(defvar orgweb-publish-stop-on-error (member "--debug" command-line-args)
  "When non-nil, stop publishing process when an error is encountered.
This variable can be set when running publish.sh script:
  ./publish.sh --debug")

(add-to-list 'load-path "~/org-mode/lisp/")
(add-to-list 'load-path "~/org-contrib/lisp/")
(require 'ox-html)


@@ 49,6 54,8 @@
        (message " [skipping] unchanged %s" org-file)
      (message "[exporting] %s" org-file)
      (with-current-buffer (find-file-noselect org-file)
        (condition-case err
            (org-html-export-to-html)
          (error (message (error-message-string err))))))))
	(if orgweb-publish-stop-on-error
	    (org-html-export-to-html)
          (condition-case err
              (org-html-export-to-html)
            (error (message (error-message-string err)))))))))