style(perfcheck): reformat
#!/bin/bash
# Need to run from the top-level node directory
-[ -d ".maintain" ] || { echo "This script must be executed from the top level node directory"; exit 1; }
+[ -d ".maintain" ] || {
+ echo "This script must be executed from the top level node directory"
+ exit 1
+}
echo "HydraDX node - Simple Performance check"
echo "---------------------------------------"
@@ -13,7 +16,10 @@ echo -n "Python version >= 3.8 ..... "
PYTHON=python3
-command -v $PYTHON >/dev/null 2>&1 || { echo "python3 required. Please install first"; exit 1; }
+command -v $PYTHON >/dev/null 2>&1 || {
+ echo "python3 required. Please install first"
+ exit 1
+}
if ! $PYTHON -c 'import sys; assert sys.version_info >= (3,8)' >/dev/null 2>&1; then
echo "Python version 3.8 or higher required."
@@ -25,8 +31,7 @@ echo "OK ($($PYTHON --version))"
echo -n "Toolchain ...... "
TOOLCHAIN=$(rustup default)
-if [[ $TOOLCHAIN = "nightly"* ]]
-then
+if [[ $TOOLCHAIN == "nightly"* ]]; then
echo "OK ($TOOLCHAIN)"
else
echo "Nightly toolchain required"
@@ -39,13 +44,12 @@ EXPECTED_BENCHWIZARD_VERSION="0.4.1"
echo -n "benchwizard >= $EXPECTED_BENCHWIZARD_VERSION ..... "
$PYTHON -m bench_wizard >/dev/null 2>&1 || {
- echo "benchwizard required. benchwizard is cli tool developed by HydraDX dev to streamline substrate benchmark process.";
- echo "Installation: pip3 install bench-wizard";
+ echo "benchwizard required. benchwizard is cli tool developed by HydraDX dev to streamline substrate benchmark process."
+ echo "Installation: pip3 install bench-wizard"
echo
read -p "Do you want to install it now? [Y/n] " -n 1 -r
echo # move to a new line
- if [[ ! $REPLY =~ ^[Yy]$ ]]
- then
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
@@ -57,13 +61,11 @@ $PYTHON -m bench_wizard >/dev/null 2>&1 || {
CURRENT_BENCH_VERSION=$($PYTHON -m bench_wizard version | tr -d '\n')
-if [[ $EXPECTED_BENCHWIZARD_VERSION > $CURRENT_BENCH_VERSION ]]
-then
- echo "Please upgrade benchwizard (current version $CURRENT_BENCH_VERSION): pip3 install bench-wizard --upgrade";
+if [[ $EXPECTED_BENCHWIZARD_VERSION > $CURRENT_BENCH_VERSION ]]; then
+ echo "Please upgrade benchwizard (current version $CURRENT_BENCH_VERSION): pip3 install bench-wizard --upgrade"
read -p "Do you want to upgrade it now? [Y/n] " -n 1 -r
echo # move to a new line
- if [[ ! $REPLY =~ ^[Yy]$ ]]
- then
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
