Update setup.sh script to use .venv instead of .env

This commit is contained in:
Matthias
2023-08-16 18:51:24 +02:00
parent ea181645b0
commit 688018d9f2
+17 -6
View File
@@ -41,12 +41,12 @@ function check_installed_python() {
} }
function updateenv() { function updateenv() {
echo_block "Updating your virtual env" echo_block "Updating your virtual environment"
if [ ! -f .env/bin/activate ]; then if [ ! -f .venv/bin/activate ]; then
echo "Something went wrong, no virtual environment found." echo "Something went wrong, no virtual environment found."
exit 1 exit 1
fi fi
source .env/bin/activate source .venv/bin/activate
SYS_ARCH=$(uname -m) SYS_ARCH=$(uname -m)
echo "pip install in-progress. Please wait..." echo "pip install in-progress. Please wait..."
${PYTHON} -m pip install --upgrade pip wheel setuptools ${PYTHON} -m pip install --upgrade pip wheel setuptools
@@ -186,7 +186,14 @@ function install_redhat() {
# Upgrade the bot # Upgrade the bot
function update() { function update() {
git pull git pull
if [ -f .env/bin/activate ]; then
# Old environment found - updating to new environment.
recreate_environments
fi
updateenv updateenv
echo "Update completed."
echo_block "Don't forget to activate your virtual enviorment with 'source .venv/bin/activate'!"
} }
function check_git_changes() { function check_git_changes() {
@@ -206,6 +213,10 @@ function recreate_environments() {
echo "Warning: Your new environment will be at .venv!" echo "Warning: Your new environment will be at .venv!"
rm -rf .env rm -rf .env
fi fi
if [ -d ".venv" ]; then
echo "- Deleting your previous virtual env"
rm -rf .venv
fi
echo echo
${PYTHON} -m venv .venv ${PYTHON} -m venv .venv
@@ -274,9 +285,9 @@ function install() {
reset reset
config config
echo_block "Run the bot !" echo_block "Run the bot !"
echo "You can now use the bot by executing 'source .env/bin/activate; freqtrade <subcommand>'." echo "You can now use the bot by executing 'source .venv/bin/activate; freqtrade <subcommand>'."
echo "You can see the list of available bot sub-commands by executing 'source .env/bin/activate; freqtrade --help'." echo "You can see the list of available bot sub-commands by executing 'source .venv/bin/activate; freqtrade --help'."
echo "You verify that freqtrade is installed successfully by running 'source .env/bin/activate; freqtrade --version'." echo "You verify that freqtrade is installed successfully by running 'source .venv/bin/activate; freqtrade --version'."
} }
function plot() { function plot() {