Skip to content

Commit

Permalink
Add direnv-allow command to approve and load .envrc (#43)
Browse files Browse the repository at this point in the history
This makes it possible to allow the changes from within emacs.
  • Loading branch information
erickgnavar authored and wbolster committed May 11, 2019
1 parent 8ad3672 commit 04102ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions direnv.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 04102ea

Please # to comment.