branch: elpa/exec-path-from-shell
commit 1115e59539e145daebeb5a05d0c1a4fb59b658a8
Author: Steve Purcell <[email protected]>
Commit: Steve Purcell <[email protected]>
Provide better info when the shell doesn't printf vars as expected
See #11
---
exec-path-from-shell.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index 5d3f3851e6..f5952bf58f 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -115,8 +115,9 @@ shell-escaped, so they may contain $ etc."
(apply #'call-process
(getenv "SHELL") nil (current-buffer) nil shell-args)
(goto-char (point-min))
- (when (re-search-forward "__RESULT\0\\(.*\\)" nil t)
- (match-string 1)))))
+ (if (re-search-forward "__RESULT\0\\(.*\\)" nil t)
+ (match-string 1)
+ (error "Expected printf output from shell, but got: %s"
(buffer-string))))))
(defun exec-path-from-shell-getenvs (names)
"Get the environment variables with NAMES from the user's shell.