Skip to content

Commit

Permalink
Change virtual environment path to "venv" in 'init.sh' and 'start.sh'
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
kozalosev committed Nov 7, 2018
1 parent 8238ce0 commit 08667a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
8 changes: 1 addition & 7 deletions .gitignore
@@ -1,13 +1,7 @@
.idea/
.pytest_cache/
__pycache__/

bin/
share/
Scripts/
[Ii]nclude/
[Ll]ib/
pyvenv.cfg
venv/

app/config.py
log.txt
Expand Down
12 changes: 6 additions & 6 deletions init.sh
@@ -1,24 +1,24 @@
#!/bin/sh

echo "Generating a virtual environment..."
python3 -m venv .
. bin/activate
python3 -m venv venv
. venv/bin/activate
echo "Installing dependencies..."
echo
pip install setuptools wheel --upgrade
pip install -r requirements.txt
echo

echo "Creating a configuration file..."
cp examples/config.py app/config.py
sudo chgrp www-data app/config.py
cp examples/config.py app/
sudo chgrp www-data app/config.py || echo "Group 'www-data' not found. Change the group of 'app/config' file manually!"
chmod o-r app/config.py
echo

echo "Done. Don't forget to replace fake values in 'app/config.py' with your actual ones."
echo "Use the '. bin/activate' command to enable the virtual environment. Inside, type 'deactivate' to disable it."
echo "Use the '. venv/bin/activate' command to enable the virtual environment. Inside, type 'deactivate' to disable it."
echo "The 'start.sh' script is a shortcut to enter the virtual environment and run the bot."
echo
echo "If you want to run tests, execute the following command in addition:"
echo " . bin/activate && pip install -r requirements-dev.txt && deactivate"
echo " . venv/bin/activate && pip install -r requirements-dev.txt && deactivate"
echo
2 changes: 1 addition & 1 deletion start.sh
@@ -1,5 +1,5 @@
#!/bin/sh

. bin/activate
. venv/bin/activate
export PYTHONPATH=app
exec app/bot.py

0 comments on commit 08667a6

Please sign in to comment.