From 3d467b7a701c9efee4e0a38b36a275220cdb66e7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 12 Mar 2019 16:20:30 -0400 Subject: [PATCH] No-op if env executable doesn't exist --- doom-modeline-env.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doom-modeline-env.el b/doom-modeline-env.el index fcb569d..e4a57c3 100644 --- a/doom-modeline-env.el +++ b/doom-modeline-env.el @@ -154,9 +154,10 @@ PARSER should be a function for parsing COMMAND's output line-by-line, to (defalias ',update-fn (lambda () (when ,enable-var - (when-let* ((command (funcall ,command-var))) - (setq doom-modeline-env--command (car command) - doom-modeline-env--command-args (cdr command) + (when-let* ((command-list (funcall ,command-var)) + (exe (executable-find (car command-list)))) + (setq doom-modeline-env--command exe + doom-modeline-env--command-args (cdr command-list) doom-modeline-env--parser ,parser-var) (doom-modeline-update-env)))) (format "Updates the %s version string in the modeline." ',name))