branch: scratch/gnus-mock
commit ee8800c6033442ddd741025783b05a346a551f22
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>

    Maybe clean up dirs if the start process fails
    
    * packages/gnus-mock/gnus-mock.el (gnus-mock-start): Check value of
      gnus-mock-cleanup-p.
---
 packages/gnus-mock/gnus-mock.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/packages/gnus-mock/gnus-mock.el b/packages/gnus-mock/gnus-mock.el
index bbf4745..715aa27 100644
--- a/packages/gnus-mock/gnus-mock.el
+++ b/packages/gnus-mock/gnus-mock.el
@@ -197,10 +197,13 @@ gnus-directory \"%s\"
       (while (re-search-forward "REPLACE_ME" (point-max) t)
        (replace-match mock-tmp-dir t))
       (basic-save-buffer))
-    (make-process :name "gnus-mock" :buffer nil
-                 :command (list gnus-mock-emacs-program
-                                "-Q" "--load" init-file)
-                 :stderr "*gnus mock errors*")))
+    (condition-case nil
+     (make-process :name "gnus-mock" :buffer nil
+                  :command (list gnus-mock-emacs-program
+                                 "-Q" "--load" init-file)
+                  :stderr "*gnus mock errors*")
+     (error (when gnus-mock-cleanup-p
+             (delete-directory mock-tmp-dir t))))))
 
 (provide 'gnus-mock)
 ;;; gnus-mock.el ends here

Reply via email to