From a2a78c0aff547741f90e423977dacbdd8cb030bd Mon Sep 17 00:00:00 2001 From: link2xt Date: Tue, 12 Dec 2023 20:18:01 +0000 Subject: [PATCH] Do not attmpt to activate venv from scripts/initenv.sh If you run it as scripts/initenv.sh, activating venv is useless as bash will exit immediately afterwards. If you `source` it as suggested by README.md, `set -e` will set the flag for the current shell and your shell will exit as soon as some command returns non-zero status, e.g. cmdeploy fails or you simply do `ls /foo/bar/baz` and `ls` complains that `/foo/bar/baz` does not exist. --- README.md | 5 +++-- scripts/initenv.sh | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d0b60c6f..d4276fa4 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,11 @@ DNS domain name (FQDN), for example `chat.example.org`. ssh root@CHATMAIL_DOMAIN ``` -2. Install the `cmdeploy` command in a virtualenv +2. Install the `cmdeploy` command in a virtualenv and activate it ``` - source scripts/initenv.sh + scripts/initenv.sh + . venv/bin/activate ``` 3. Create chatmail configuration file `chatmail.ini`: diff --git a/scripts/initenv.sh b/scripts/initenv.sh index 7e96937c..dba58481 100755 --- a/scripts/initenv.sh +++ b/scripts/initenv.sh @@ -4,6 +4,3 @@ python3 -m venv venv venv/bin/pip install -e chatmaild venv/bin/pip install -e cmdeploy - -source venv/bin/activate -echo activated 'venv' python virtualenv environment containing "cmdeploy" tool