Skip to content

Commit

Permalink
Revert "fix: prefix conda commands with conda" (nushell#820)
Browse files Browse the repository at this point in the history
Reverts nushell#816

Fixes nushell#818
  • Loading branch information
kubouch committed Apr 17, 2024
1 parent c33c780 commit 1a4c6e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions modules/virtual_environments/conda.nu
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions modules/virtual_environments/nu_conda/nu_conda.nu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 |
Expand Down
4 changes: 2 additions & 2 deletions modules/virtual_environments/nu_conda_2/conda.nu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 1a4c6e9

Please sign in to comment.