Skip to content

Commit

Permalink
Remove spawn -n mentions in documentation (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp authored Jan 29, 2025
1 parent 73a612f commit 0b6127d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Activate conda environments in new shell processes.

`conda spawn` is a replacement subcommand for the `conda activate` and `conda deactivate` workflow

Instead of writing state to your current shell session, `conda spawn -n ENV-NAME` will start a new shell with your activated environment. To deactivate, exit the process with <kbd>Ctrl</kbd>+<kbd>D</kbd>, or run the command `exit`.
Instead of writing state to your current shell session, `conda spawn ENV-NAME` will start a new shell with your activated environment. To deactivate, exit the process with <kbd>Ctrl</kbd>+<kbd>D</kbd>, or run the command `exit`.

## Installation

Expand Down
6 changes: 3 additions & 3 deletions conda_spawn/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ def configure_parser(parser: argparse.ArgumentParser):
"""
Examples for --hook usage in different shells:
POSIX:
source "$(conda spawn --hook -n ENV-NAME)"
source "$(conda spawn --hook ENV-NAME)"
CMD:
FOR /F "tokens=*" %%g IN ('conda spawn --hook -n ENV-NAME') do @CALL %%g
FOR /F "tokens=*" %%g IN ('conda spawn --hook ENV-NAME') do @CALL %%g
Powershell:
conda spawn --hook -n ENV-NAME | Out-String | Invoke-Expression
conda spawn --hook ENV-NAME | Out-String | Invoke-Expression
"""
).lstrip()

Expand Down
8 changes: 4 additions & 4 deletions docs/howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ For in-script usage, please consider these replacements for `conda activate`:
For Unix shell scripts:

```bash
eval "$(conda spawn --hook --shell posix -n <ENV-NAME>)"
eval "$(conda spawn --hook --shell posix <ENV-NAME>)"
```

For Windows CMD scripts:

```batch
FOR /F "tokens=*" %%g IN ('conda spawn --hook --shell cmd -n <ENV-NAME>') do @CALL %%g
FOR /F "tokens=*" %%g IN ('conda spawn --hook --shell cmd <ENV-NAME>') do @CALL %%g
```

For Windows Powershell scripts:

```powershell
conda spawn --hook --shell powershell -n <ENV-NAME> | Out-String | Invoke-Expression
conda spawn --hook --shell powershell <ENV-NAME> | Out-String | Invoke-Expression
```

For example, if you want to create a new environment and activate it, it would look like this:

```bash
# Assumes `conda` is in PATH
conda create -n new-env python numpy
eval "$(conda spawn --hook --shell powershell -n new-env)"
eval "$(conda spawn --hook --shell powershell new-env)"
python -c "import numpy"
```

Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

`conda spawn` is a replacement subcommand for the `conda activate` and `conda deactivate` workflow.

Instead of writing state to your current shell session, `conda spawn -n ENV-NAME` starts a new shell with your activated environment. To deactivate, exit the process with <kbd>Ctrl</kbd>+<kbd>D</kbd>, or run the command `exit`.
Instead of writing state to your current shell session, `conda spawn ENV-NAME` starts a new shell with your activated environment. To deactivate, exit the process with <kbd>Ctrl</kbd>+<kbd>D</kbd>, or run the command `exit`.

The typical workflow looks like this:

Expand Down

0 comments on commit 0b6127d

Please sign in to comment.