diff --git a/modules/virtual_environments/conda.nu b/modules/virtual_environments/conda.nu index 270be37aa..70fd4f531 100644 --- a/modules/virtual_environments/conda.nu +++ b/modules/virtual_environments/conda.nu @@ -1,5 +1,5 @@ # Activate conda environment -export def --env "conda activate" [ +export def --env activate [ env_name?: string@'nu-complete conda envs' # name of the environment ] { let conda_info = (conda info --envs --json | from json) @@ -73,7 +73,7 @@ export def --env "conda activate" [ } # Deactivate currently active conda environment -export def --env "conda deactivate" [] { +export def --env deactivate [] { let path_name = if "PATH" in $env { "PATH" } else { "Path" } $env.$path_name = $env.CONDA_OLD_PATH diff --git a/modules/virtual_environments/nu_conda/nu_conda.nu b/modules/virtual_environments/nu_conda/nu_conda.nu index 4383c0435..89a9b4d03 100644 --- a/modules/virtual_environments/nu_conda/nu_conda.nu +++ b/modules/virtual_environments/nu_conda/nu_conda.nu @@ -22,7 +22,7 @@ export-env { $env.CONDA_CURR = null } -export def --env "conda activate" [name: string] { +export def --env activate [name: string] { if ($env.CONDA_ROOT | is-empty) { print "Neither Conda nor Mamba is valid." return @@ -44,7 +44,7 @@ export def --env "conda activate" [name: string] { load-env ({CONDA_CURR: $name} | merge $new_path) } -export def --env "conda deactivate" [] { +export def --env deactivate [] { if ($env.CONDA_ROOT | is-empty) { print "Neither Conda nor Mamba is valid." return @@ -55,7 +55,7 @@ export def --env "conda deactivate" [] { load-env {Path: $env.CONDA_BASE_PATH, PATH: $env.CONDA_BASE_PATH} } -export def --env "conda list" [] { +export def --env list [] { $env.CONDA_ENVS | flatten | transpose | diff --git a/modules/virtual_environments/nu_conda_2/conda.nu b/modules/virtual_environments/nu_conda_2/conda.nu index cd206a302..ccbd3e062 100644 --- a/modules/virtual_environments/nu_conda_2/conda.nu +++ b/modules/virtual_environments/nu_conda_2/conda.nu @@ -21,7 +21,7 @@ def --env load-conda-info-env [] { } # Activate conda environment -export def --env "conda activate" [ +export def --env activate [ env_name: string@'nu-complete conda envs' = "base" # name of the environment ] { load-conda-info-env @@ -94,7 +94,7 @@ export def --env "conda activate" [ } # Deactivate currently active conda environment -export def --env "conda deactivate" [] { +export def --env deactivate [] { let path_name = if "PATH" in $env { "PATH" } else { "Path" } $env.$path_name = $env.CONDA_OLD_PATH