on master help sign in
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.

commit0fa99518ce6156ab4c427b260505bc346170e92f authorMartin Nordholts <enselic@gmail.com> dateWed 2 Feb 2022, 21:02 (5 years ago) parenta565662
1 file changed+5−5
tests/benchmarks/run-benchmarks.sh+5−5
tests/benchmarks/run-benchmarks.sh+5−5
@@ -9,15 +9,15 @@ if ! command -v hyperfine > /dev/null 2>&1; then
99 exit 1
1010fi
1111
12−# Check that jq is installed.
13−if ! command -v jq > /dev/null 2>&1; then
14− echo "'jq' does not seem to be installed."
15− echo "You can get it here: https://stedolan.github.io/jq"
12+# Check that python3 is installed.
13+if ! command -v python3 > /dev/null 2>&1; then
14+ echo "'python3' does not seem to be installed."
15+ echo "You can get it here: https://www.python.org/downloads/"
1616 exit 1
1717fi
1818
1919get_cargo_target_dir() {
20− cargo metadata --no-deps --format-version 1 | jq -r .target_directory
20+ cargo metadata --no-deps --format-version 1 | python3 -c 'import sys, json; print(json.load(sys.stdin)["target_directory"])'
2121}
2222
2323heading() {