Skip to content

Commit 2396484

Browse files
committed
Add check for activated virtual environment
1 parent 01aacaf commit 2396484

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/venv-cli/venv.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ venv::raise() {
3434
return "${_fail}"
3535
}
3636

37+
venv::_check_venv_activated() {
38+
if [ -z "${VIRTUAL_ENV}" ]; then
39+
venv::raise "No virtual environment activated. Please activate the virtual environment first"
40+
return "${_fail}"
41+
fi
42+
return "${_success}"
43+
}
44+
3745
venv::_check_if_help_requested() {
3846
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
3947
return "${_success}"

0 commit comments

Comments
 (0)