From 0fa99518ce6156ab4c427b260505bc346170e92f Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Wed, 2 Feb 2022 21:02:31 +0100 Subject: [PATCH] run-benchmarks.sh: Use `python3` oneliner instead of `jq` I am setting up a new computer and thus are missing a lot of tools. I noticed we rely on `jq` being installed, which is a bit annoying when it is not installed yet. We can quite easily get rid of this dependecy on `jq` by using a simple `python3` oneliner. --- tests/benchmarks/run-benchmarks.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/benchmarks/run-benchmarks.sh b/tests/benchmarks/run-benchmarks.sh index d1f21fd9..7542abbf 100755 --- a/tests/benchmarks/run-benchmarks.sh +++ b/tests/benchmarks/run-benchmarks.sh @@ -9,15 +9,15 @@ if ! command -v hyperfine > /dev/null 2>&1; then exit 1 fi -# Check that jq is installed. -if ! command -v jq > /dev/null 2>&1; then - echo "'jq' does not seem to be installed." - echo "You can get it here: https://stedolan.github.io/jq" +# Check that python3 is installed. +if ! command -v python3 > /dev/null 2>&1; then + echo "'python3' does not seem to be installed." + echo "You can get it here: https://www.python.org/downloads/" exit 1 fi get_cargo_target_dir() { - cargo metadata --no-deps --format-version 1 | jq -r .target_directory + cargo metadata --no-deps --format-version 1 | python3 -c 'import sys, json; print(json.load(sys.stdin)["target_directory"])' } heading() {