Browse Source

benchmark: update generate_weight script to handle errors

conectado 4 years ago
parent
commit
d140ad258b
1 changed files with 6 additions and 3 deletions
  1. 6 3
      scripts/generate-weights.sh

+ 6 - 3
scripts/generate-weights.sh

@@ -14,6 +14,9 @@ $SCRIPT_DIR/../target/release/joystream-node benchmark \
     --execution=wasm \
     --output=.  > /dev/null
 
-mv $SCRIPT_DIR/../*.rs $SCRIPT_DIR/../runtime/src/weights/
-
-echo "Weights generated successfully"
+if [ $? -eq 0 ]; then
+    mv $SCRIPT_DIR/../*.rs $SCRIPT_DIR/../runtime/src/weights/
+    echo "Weights generated successfully"
+else
+    echo "There was a problem generating the new weights, check the error above"
+fi