Indent functions code

This commit is contained in:
Gerald Lonlas 2018-01-28 23:35:13 -08:00
parent 96c54716d7
commit 7321836bfb

View File

@ -1,10 +1,5 @@
#!/usr/bin/env bash
#encoding=utf8
freqtradepath=$(pwd)
function go_to_folder () {
cd $freqtradepath
}
function updateenv () {
echo "
@ -50,23 +45,18 @@ install_talib
# Upgrade the bot
function update () {
go_to_folder
git pull
updateenv
}
# Reset Develop or Master branch
function reset () {
echo "
----------------------------
Reset branch and virtual env
----------------------------
"
echo "----------------------------"
echo "Reset branch and virtual env"
echo "----------------------------"
echo
if [ "1" == $(git branch -vv |grep -cE "\* develop|\* master") ]
then
go_to_folder
if [ -d ".env" ]; then
echo "- Delete your previous virtual env"
rm -rf .env
@ -95,42 +85,30 @@ function config_generator () {
echo "Starting to generate config.json"
echo "
-------------------------
General configuration
-------------------------
"
read -p "Max open trades: (Default: 3)
" max_trades
echo "-------------------------"
echo "General configuration"
echo "-------------------------"
echo
read -p "Max open trades: (Default: 3) " max_trades
read -p "Stake amount: (Default: 0.05)
" stake_amount
read -p "Stake amount: (Default: 0.05) " stake_amount
read -p "Stake currency: (Default: BTC)
" stake_currency
read -p "Stake currency: (Default: BTC) " stake_currency
read -p "Fiat currency: (Default: USD)
" fiat_currency
read -p "Fiat currency: (Default: USD) " fiat_currency
echo "
------------------------
Bittrex config generator
------------------------
"
read -p "Exchange API key
" api_key
read -p "Exchange API Secret
" -s api_secret
echo "------------------------"
echo "Bittrex config generator"
echo "------------------------"
echo
read -p "Exchange API key: " api_key
read -p "Exchange API Secret: " api_secret
echo "
-------------------------
Telegram config generator
-------------------------
"
read -p "Telegram Token
" -s token
read -p "Telegram Chat_id
" chat_id
echo "-------------------------"
echo "Telegram config generator"
echo "-------------------------"
read -p "Telegram Token: " token
read -p "Telegram Chat_id: " chat_id
sed -e "s/\"max_open_trades\": 3,/\"max_open_trades\": $max_trades,/g" \
-e "s/\"stake_amount\": 0.05,/\"stake_amount\": $stake_amount,/g" \
@ -145,11 +123,9 @@ sed -e "s/\"max_open_trades\": 3,/\"max_open_trades\": $max_trades,/g" \
}
function config () {
go_to_folder
if [ -f config.json ]
then
read -p "A config file already exist, do you want to override it [Y/N]?
"
read -p "A config file already exist, do you want to override it [Y/N]? "
if [[ $REPLY =~ ^[Yy]$ ]]
then
config_generator
@ -164,13 +140,11 @@ echo "Edit ./config.json to modify Pair and other configurations."
}
function install () {
echo "
-------------------------
Install mandatory dependencies
-------------------------
"
echo "-------------------------"
echo "Install mandatory dependencies"
echo "-------------------------"
echo
go_to_folder
if [ "$(uname -s)" == "Darwin" ]
then
echo "- You are on macOS"
@ -199,7 +173,7 @@ echo "
Install dependencies for Plotting scripts
-----------------------------------------
"
pip install plotly
pip install plotly --upgrade
}
function help () {