mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 02:12:01 +00:00
setup.sh: Extract environment recration to function
This commit is contained in:
parent
f607b8abfb
commit
ea181645b0
28
setup.sh
28
setup.sh
|
@ -199,6 +199,23 @@ function check_git_changes() {
|
|||
fi
|
||||
}
|
||||
|
||||
function recreate_environments() {
|
||||
if [ -d ".env" ]; then
|
||||
# Remove old virtual env
|
||||
echo "- Deleting your previous virtual env"
|
||||
echo "Warning: Your new environment will be at .venv!"
|
||||
rm -rf .env
|
||||
fi
|
||||
|
||||
echo
|
||||
${PYTHON} -m venv .venv
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Could not create virtual environment. Leaving now"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# Reset Develop or Stable branch
|
||||
function reset() {
|
||||
echo_block "Resetting branch and virtual env"
|
||||
|
@ -225,17 +242,8 @@ function reset() {
|
|||
else
|
||||
echo "Reset ignored because you are not on 'stable' or 'develop'."
|
||||
fi
|
||||
recreate_environments
|
||||
|
||||
if [ -d ".env" ]; then
|
||||
echo "- Deleting your previous virtual env"
|
||||
rm -rf .env
|
||||
fi
|
||||
echo
|
||||
${PYTHON} -m venv .env
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Could not create virtual environment. Leaving now"
|
||||
exit 1
|
||||
fi
|
||||
updateenv
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user