Skip to content

Commit

Permalink
Merge pull request #1 from d00vy/patch-1
Browse files Browse the repository at this point in the history
Feature: added test for dependencies
  • Loading branch information
rleons authored May 6, 2021
2 parents ffeb493 + 2f25b56 commit 0fd7647
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion markets-picker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ if [ -z ${minChange+x} ]; then
exit 1
fi

# Check for dependencies | d00vy
echo $(date +"%Y/%m/%d %H:%M:%S") "[INFO] Testing for dependencies..."
if (cryptotrader about) | grep -q 'Stefan'; then
:
else echo $(date +"%Y/%m/%d %H:%M:%S") "[ERROR] Please install 'cryptotrader'..."; exit 1
fi
if (jq --help) | grep -q 'JSON'; then
:
else echo $(date +"%Y/%m/%d %H:%M:%S") "[ERROR] Please install 'jq'..."; exit 1
fi
if (bc --help) | grep -q 'mathlib'; then
:
else echo $(date +"%Y/%m/%d %H:%M:%S") "[ERROR] Please install 'bc'..."; exit 1
fi
echo $(date +"%Y/%m/%d %H:%M:%S") "[INFO] Dependencies met..."

# Get markets and filter by quote
echo $(date +"%Y/%m/%d %H:%M:%S") "[INFO] Loading markets from $exchange..."
markets=$(cryptotrader markets --exchange=$exchange \
Expand Down Expand Up @@ -148,4 +164,4 @@ symCount=$(echo "$symbols" | awk -F "," '{print NF-1}')
symbols=$(echo $symbols | sed 's/.$//') # Trim extra comma from end of string | Another approach: pairs=${pairs%,}
echo $(date +"%Y/%m/%d %H:%M:%S") "[INFO] Filtered a total of $symCount $quoteCurr markets:"
echo $(date +"%Y/%m/%d %H:%M:%S") "[INFO] $symbols"
echo
echo

0 comments on commit 0fd7647

Please sign in to comment.