From 04102eadb408f7691f299dcc2bc01e7853de0fad Mon Sep 17 00:00:00 2001 From: Erick Navarro Date: Sat, 11 May 2019 08:13:16 -0700 Subject: [PATCH] Add direnv-allow command to approve and load .envrc (#43) This makes it possible to allow the changes from within emacs. --- direnv.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/direnv.el b/direnv.el index 87f8d2b..3ed8913 100644 --- a/direnv.el +++ b/direnv.el @@ -235,6 +235,13 @@ When FORCE-SUMMARY is non-nil or when called interactively, show a summary messa (with-editor-async-shell-command "direnv edit" nil nil)) (direnv-update-environment)) +;;;###autoload +(defun direnv-allow () + "Run ‘direnv allow’ and update the environment afterwards." + (interactive) + (call-process (direnv--detect) nil 0 nil "allow") + (direnv-update-environment)) + ;;;###autoload (define-minor-mode direnv-mode "Global minor mode to automatically update the environment using direnv.