diff options
author | Martin Nordholts <enselic@gmail.com> | 2022-02-02 21:02:31 +0100 |
---|---|---|
committer | Martin Nordholts <enselic@gmail.com> | 2022-02-03 08:00:14 +0100 |
commit | 0fa99518ce6156ab4c427b260505bc346170e92f (patch) | |
tree | 1e8d572a2da39c02076c37d30e4193c690bd8cb5 | |
parent | a565662cf319f5a0e63bae12cde491f8c1ae30c7 (diff) |
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.
-rwxr-xr-x | tests/benchmarks/run-benchmarks.sh | 10 |
1 files 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() { |