From 55747c20fc8629eb44fd44ba7778c77312925f00 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 11 Nov 2020 18:11:33 +0800 Subject: [PATCH] update setup script --- scripts/setup.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) mode change 100644 => 100755 scripts/setup.sh diff --git a/scripts/setup.sh b/scripts/setup.sh old mode 100644 new mode 100755 index 763dd3998..f6eaced2d --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -11,7 +11,13 @@ if [[ ! -e "bbgo" ]] ; then fi -if [[ ! -e "bbgo.yaml" ]] ; then +if [[ -e "bbgo.yaml" ]] ; then + echo "Found existing bbgo.yaml, you will overwrite the existing bbgo.yaml file!" + read -p "Are you sure? (Y/n) " a + if [[ $a == "n" ]] ; then + exit + fi +fi cat < bbgo.yaml --- @@ -39,11 +45,18 @@ exchangeStrategies: lowerPrice: 11000.0 END +echo "BBGO Config file is generated" + +if [[ -e ".env.local" ]] ; then + echo "Found existing .env.local, you will overwrite the existing .env.local file!" + read -p "Are you sure? (Y/n) " a + if [[ $a == "n" ]] ; then + exit + fi fi -if [[ ! -e ".env.local" ]] ; then - read -p "Enter your MAX API key: " api_key + read -p "Enter your MAX API secret: " api_secret echo "Generating your .env.local file..." @@ -52,7 +65,6 @@ export MAX_API_KEY=$api_key export MAX_API_SECRET=$api_secret END -fi echo "Now you can edit your strategy config file bbgo.yaml to run bbgo" if [[ $osf == "darwin" ]] ; then