Skip to content

Commit a6414f4

Browse files
committed
Add conda-reload-config helper
1 parent 0fe78a8 commit a6414f4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

conda.el

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ See https://github.com/conda/conda/blob/master/CHANGELOG.md#484-2020-08-06."
208208
"Cached copy of configuration that Conda sees (including `condarc', etc).
209209
Set for the lifetime of the process.")
210210

211-
(defun conda--get-config()
212-
"Return current Conda configuration. Cached for the lifetime of the process."
213-
(if (not (eq conda--config nil))
211+
(defun conda--get-config (&optional force-reload)
212+
"Return current configuration. Cached for the process' lifetime, unless FORCE-RELOAD."
213+
(if (and (not force-reload) (not (eq conda--config nil)))
214214
conda--config
215215
(let ((cfg (conda--call-json "config" "--show" "--json")))
216216
(setq conda--config cfg))))
@@ -476,6 +476,12 @@ Returns a list of new path elements."
476476

477477
;; potentially interactive user-exposed functions
478478

479+
(defun conda-reload-config ()
480+
"Force-reloads the Conda configuration and displays it."
481+
(interactive)
482+
(let ((cfg (conda--get-config t)))
483+
(message cfg)))
484+
479485
;;;###autoload
480486
(defun conda-env-deactivate ()
481487
"Deactivate the current conda env."

0 commit comments

Comments
 (0)