update setup script

This commit is contained in:
c9s 2020-11-11 18:11:33 +08:00
parent 907cf1ffc1
commit 55747c20fc

20
scripts/setup.sh Normal file → Executable file
View File

@ -11,7 +11,13 @@ if [[ ! -e "bbgo" ]] ; then
fi 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 <<END > bbgo.yaml cat <<END > bbgo.yaml
--- ---
@ -39,11 +45,18 @@ exchangeStrategies:
lowerPrice: 11000.0 lowerPrice: 11000.0
END 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 fi
if [[ ! -e ".env.local" ]] ; then
read -p "Enter your MAX API key: " api_key read -p "Enter your MAX API key: " api_key
read -p "Enter your MAX API secret: " api_secret read -p "Enter your MAX API secret: " api_secret
echo "Generating your .env.local file..." echo "Generating your .env.local file..."
@ -52,7 +65,6 @@ export MAX_API_KEY=$api_key
export MAX_API_SECRET=$api_secret export MAX_API_SECRET=$api_secret
END END
fi
echo "Now you can edit your strategy config file bbgo.yaml to run bbgo" echo "Now you can edit your strategy config file bbgo.yaml to run bbgo"
if [[ $osf == "darwin" ]] ; then if [[ $osf == "darwin" ]] ; then