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

Revert "fix: prefix conda commands with conda" #820

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
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
Revert "fix: prefix conda commands with conda (#816)"
This reverts commit 0d665a7.
  • Loading branch information
kubouch committed Apr 17, 2024
commit b2a74820e6625bc385c0e9da5a912ea5a632159a
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