mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 16:24:18 +00:00
Make the emacs respond to broken script
This commit is contained in:
parent
fd002e1fc5
commit
570b7cc7ee
1 changed files with 9 additions and 4 deletions
11
helpers.org
11
helpers.org
|
|
@ -59,10 +59,15 @@
|
|||
* Sending reports to mom
|
||||
#+begin_src emacs-lisp
|
||||
(defun my/run-report-get-file-name (arg)
|
||||
(aprog1 (--> (format "./mom_report_2.sh %s"
|
||||
(aprog1
|
||||
(with-temp-buffer
|
||||
(let ((return-code
|
||||
(--> (format "./mom_report_2.sh %s"
|
||||
(if arg "end" "mid"))
|
||||
(shell-command-to-string it)
|
||||
(string-trim it))
|
||||
(call-process-shell-command it nil (current-buffer)))))
|
||||
(if (not (eq return-code 0))
|
||||
(error "Script is broken")
|
||||
(string-trim (buffer-string)))))
|
||||
(save-window-excursion
|
||||
(let ((buff (find-buffer-visiting it)))
|
||||
(if (not buff)
|
||||
|
|
|
|||
Loading…
Reference in a new issue