Skip to content

Commit 8e36761

Browse files
authored
Fixes #2793 - replace use of [[ conditionals (#2794)
## Summary Fixes #2793 - use of zsh/bash conditionals in a file with a pure sh shebang. ## How was it tested? ## Community Contribution License All community contributions in this pull request are licensed to the project maintainers under the terms of the [Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0). By creating this pull request, I represent that I have the right to license the contributions to the project maintainers under the Apache 2 License as stated in the [Community Contribution License](https://github.com/jetify-com/opensource/blob/main/CONTRIBUTING.md#community-contribution-license). --------- Signed-off-by: Tim Gates <tim.gates@iress.com>
1 parent d6bd8d5 commit 8e36761

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

plugins/python/venvShellHook.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,15 @@ if [ -d "$VENV_DIR" ]; then
3535
echo "Do you want to overwrite it? (y/n)"
3636
read reply
3737
echo
38-
if [[ $reply =~ ^[Yy]$ ]]; then
39-
echo "Overwriting existing virtual environment..."
40-
create_venv
41-
elif [[ $reply =~ ^[Nn]$ ]]; then
42-
echo "Using your existing virtual environment. We recommend changing \$VENV_DIR to a different location"
43-
touch "$STATE_FILE"
44-
exit 0
45-
else
46-
echo "Invalid input. Exiting..."
47-
exit 1
48-
fi
38+
case "$reply" in
39+
[Yy]) echo "Overwriting existing virtual environment..."
40+
create_venv ;;
41+
[Nn]) echo "Using your existing virtual environment. We recommend changing \$VENV_DIR to a different location"
42+
touch "$STATE_FILE"
43+
exit 0 ;;
44+
*) echo "Invalid input. Exiting..."
45+
exit 1 ;;
46+
esac
4947
fi
5048
else
5149
echo "Directory exists but is not a valid virtual environment. Creating a new one..."

0 commit comments

Comments
 (0)