Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbauer committed Oct 30, 2024
1 parent e10f59f commit b959f1e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions site-lisp/envrc.el
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ DIRECTORY is the directory in which the environment changes."
result
process)
(message "Running direnv in %s..." env-dir)
(puthash cache-key (cons callback ()) envrc--running-processes-callbacks)
(puthash cache-key (cons callback (gethash cache-key envrc--running-processes-callbacks)) envrc--running-processes-callbacks)
(puthash cache-key (envrc--make-process-with-global-env
`("direnv" "export" "json")
(lambda (exit-code stdout stderr)
Expand Down Expand Up @@ -353,12 +353,11 @@ DIRECTORY is the directory in which the environment changes."
(envrc--export-new-process env-dir callback))
(callbacks
;; Make sure process is still running.
(let ((process (gethash cache-key envrc--running-processes)))
(if (and process (memq (process-status process) '(open run stop)))
(let ((process (gethash cache-key envrc--running-process)))
(if (and process (memq (process-status proc) '(open run stop)))
(puthash cache-key (push callback callbacks) envrc--running-processes-callbacks)
(progn
(message "Process got killed. ")
(remhash cache-key envrc--running-processes)
(remhash cache-key envrc--running-process)
(envrc--export-new-process env-dir callback))))))))

;; Forward declaration for the byte compiler
Expand Down

0 comments on commit b959f1e

Please sign in to comment.