[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/exec-path-from-shell 0f53502d46 068/114: Produce error at
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/exec-path-from-shell 0f53502d46 068/114: Produce error at runtime if SHELL is unset |
Date: |
Tue, 5 Sep 2023 04:00:01 -0400 (EDT) |
branch: elpa/exec-path-from-shell
commit 0f53502d463eeeaefe48dfeb0c2fbaac1e6302e3
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>
Produce error at runtime if SHELL is unset
Fixes #51
---
exec-path-from-shell.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/exec-path-from-shell.el b/exec-path-from-shell.el
index de463f4653..f35b142d27 100644
--- a/exec-path-from-shell.el
+++ b/exec-path-from-shell.el
@@ -97,6 +97,10 @@ Environment variables should be set in .profile or .zshenv
rather than
"Double-quote S, escaping any double-quotes already contained in it."
(concat "\"" (replace-regexp-in-string "\"" "\\\\\"" s) "\""))
+(defun exec-path-from-shell--shell ()
+ "Return the shell to use."
+ (or (getenv "SHELL") (error "SHELL environment variable is unset")))
+
(defcustom exec-path-from-shell-arguments
(if (string-match-p "t?csh$" (or (getenv "SHELL") ""))
(list "-d")
@@ -133,12 +137,12 @@ shell-escaped, so they may contain $ etc."
(concat printf-bin
" '__RESULT\\000" str "' "
(mapconcat #'exec-path-from-shell--double-quote args " ")))
+ (shell (exec-path-from-shell--shell))
(shell-args (append exec-path-from-shell-arguments
(list "-c"
- (if (exec-path-from-shell--standard-shell-p
(getenv "SHELL"))
+ (if (exec-path-from-shell--standard-shell-p
shell)
printf-command
- (concat "sh -c " (shell-quote-argument
printf-command))))))
- (shell (getenv "SHELL")))
+ (concat "sh -c " (shell-quote-argument
printf-command)))))))
(with-temp-buffer
(exec-path-from-shell--debug "Invoking shell %s with args %S" shell
shell-args)
(let ((exit-code (apply #'call-process shell nil t nil shell-args)))
- [nongnu] elpa/exec-path-from-shell 76fbdf5d01 092/114: Fix ignore pattern in Actions YAML, (continued)
- [nongnu] elpa/exec-path-from-shell 76fbdf5d01 092/114: Fix ignore pattern in Actions YAML, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 6124001b69 101/114: Checkdoc fixes, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 4c3fbc3d7f 108/114: "docstring wider than 80 characters", ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 3a8d97c096 110/114: Show how I add NIX_PATH, SSH_AUTH_SOCK etc. to vars list, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell c2a727fe34 062/114: fix defcustom loading when env SHELL is empty, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 192c5341c5 044/114: Update MELPA URLs, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 18cad603c4 100/114: Mention applicability to running a daemon from systemd, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell ddd24dc823 113/114: Add Emacs 28.2 to CI, cut down size of matrix, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 30df5be792 064/114: Minor README fix, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 39755bf322 045/114: Use 'el' code block type rather than 'scheme', ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 0f53502d46 068/114: Produce error at runtime if SHELL is unset,
ELPA Syncer <=
- [nongnu] elpa/exec-path-from-shell 4c67a95a65 079/114: Add explicit GPL 3 license, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell f858b05cf9 083/114: Make installation instructions more explicit, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 76cd6e3fa8 086/114: Don't use -i by default with Fish (see #87), ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell ddd608cd19 097/114: Enable lexical-binding, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell a45edbc2d0 105/114: Per suggestion, change only the default value of eshell-path-env, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell 4d6a6aa180 060/114: Correct a function name in the README, ELPA Syncer, 2023/09/05
- [nongnu] elpa/exec-path-from-shell b0449230d8 053/114: Distinguish between empty ("") and unset env vars, ELPA Syncer, 2023/09/05