Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conda-reload-config helper #136

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions conda.el
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ See https://github.com/conda/conda/blob/master/CHANGELOG.md#484-2020-08-06."
"Cached copy of configuration that Conda sees (including `condarc', etc).
Set for the lifetime of the process.")

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

;; potentially interactive user-exposed functions

(defun conda-reload-config ()
"Force-reloads the Conda configuration and displays it."
(interactive)
(let ((cfg (conda--get-config t)))
(message cfg)))

;;;###autoload
(defun conda-env-deactivate ()
"Deactivate the current conda env."
Expand Down
Loading