Unverified Commit 1e708cbd authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Fixes conda env name matching in orbit.sh (#391)

# Description

Previously, if you had two environments named `orbit` and `orbit_2024`.
If you delete the environment `orbit` to rename it, the grep search
would try to match `orbit_2024` with `orbit` and say the environment
exists.

This MR fixes the grep matching in `orbit.sh` to return success only if
the entire word matches.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have run all the tests with `./orbit.sh --test` and they pass
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
parent 6c9cd7ca
......@@ -107,7 +107,7 @@ setup_conda_env() {
build_path=${ORBIT_PATH}/_isaac_sim
fi
# check if the environment exists
if { conda env list | grep ${env_name}; } >/dev/null 2>&1; then
if { conda env list | grep -w ${env_name}; } >/dev/null 2>&1; then
echo -e "[INFO] Conda environment named '${env_name}' already exists."
else
echo -e "[INFO] Creating conda environment named '${env_name}'..."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment