Skip to content

Commit c4e1fb5

Browse files
authored
Merge pull request #2575 from ondohotola/benchmarks
Update benchmarks.sh
2 parents 572e0ed + 752de7b commit c4e1fb5

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

Diff for: scripts/benchmarks.sh

+23-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Usage: ./benchmarks.sh <argument>
44
# where <argument> is a substring pattern of the benchmark name.
@@ -109,10 +109,10 @@ fi
109109

110110
# check if required tools/dependencies are installed ---------
111111

112-
# check if benchmarker_bin has the apply feature enabled
113-
if [[ "$benchmarker_version" != *"apply;"* ]]; then
114-
echo "ERROR: $qsv_benchmarker_bin does not have the apply feature enabled."
115-
echo "The qsv apply command is needed to format the benchmarks results."
112+
# check if benchmarker_bin has the apply feature enabled
113+
if [[ "$benchmarker_version" != *"apply;"* ]]; then
114+
echo "ERROR: $qsv_benchmarker_bin does not have the apply feature enabled."
115+
echo "The qsv apply command is needed to format the benchmarks results."
116116
exit
117117
fi
118118

@@ -184,8 +184,22 @@ if [[ "$arg_pat" == "setup" ]]; then
184184
# check if homebrew is installed, if not, install it
185185
# as we need it to install the required tools
186186
if ! command -v brew &>/dev/null; then
187-
echo "INFO: Homebrew could not be found. Installing brew first. Please enter requested info when prompted."
188-
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
187+
echo -n "INFO: Homebrew could not be found. Do you wish to install? "
188+
read -p '(Requires sudo) (y/n)? ' -r CHOICE
189+
case "$CHOICE" in
190+
y | Y)
191+
echo "Installing brew. Please enter requested info when prompted."
192+
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
193+
;;
194+
n | N)
195+
echo "Not installing brew. Review https://brew.sh/"
196+
exit
197+
;;
198+
*)
199+
echo 'Invalid entry (only y/n)'
200+
exit
201+
;;
202+
esac
189203
fi
190204

191205
# if 7z is not installed, install it
@@ -663,8 +677,8 @@ run --index stats_everything_index_j1_with_cache "$qsv_bin" stats "$data" --ever
663677
run --index stats_everything_sorted_index "$qsv_bin" stats data_sorted.csv --force --everything
664678
run --index stats_everything_sorted_index_with_cache "$qsv_bin" stats data_sorted.csv --everything --cache-threshold 1
665679
run table "$qsv_bin" table "$data"
666-
run template "$qsv_bin" template --template-file template.tpl "$data" > /dev/null
667-
run template_lookup_outdir "$qsv_bin" template --template-file template-with-cb-lookup.tpl "$data" > /dev/null
680+
run template "$qsv_bin" template --template-file template.tpl "$data" >/dev/null
681+
run template_lookup_outdir "$qsv_bin" template --template-file template-with-cb-lookup.tpl "$data" >/dev/null
668682
run to_xlsx "$qsv_bin" to xlsx benchmark_work.xlsx "$data"
669683
run to_sqlite "$qsv_bin" to sqlite benchmark_work.db "$data"
670684
run to_datapackage "$qsv_bin" to datapackage benchmark_work.json "$data"

0 commit comments

Comments
 (0)