|
1 |
| -#!/bin/bash |
| 1 | +#!/usr/bin/env bash |
2 | 2 | #
|
3 | 3 | # Usage: ./benchmarks.sh <argument>
|
4 | 4 | # where <argument> is a substring pattern of the benchmark name.
|
|
109 | 109 |
|
110 | 110 | # check if required tools/dependencies are installed ---------
|
111 | 111 |
|
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." |
116 | 116 | exit
|
117 | 117 | fi
|
118 | 118 |
|
@@ -184,8 +184,22 @@ if [[ "$arg_pat" == "setup" ]]; then
|
184 | 184 | # check if homebrew is installed, if not, install it
|
185 | 185 | # as we need it to install the required tools
|
186 | 186 | 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 |
189 | 203 | fi
|
190 | 204 |
|
191 | 205 | # if 7z is not installed, install it
|
@@ -663,8 +677,8 @@ run --index stats_everything_index_j1_with_cache "$qsv_bin" stats "$data" --ever
|
663 | 677 | run --index stats_everything_sorted_index "$qsv_bin" stats data_sorted.csv --force --everything
|
664 | 678 | run --index stats_everything_sorted_index_with_cache "$qsv_bin" stats data_sorted.csv --everything --cache-threshold 1
|
665 | 679 | 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 |
668 | 682 | run to_xlsx "$qsv_bin" to xlsx benchmark_work.xlsx "$data"
|
669 | 683 | run to_sqlite "$qsv_bin" to sqlite benchmark_work.db "$data"
|
670 | 684 | run to_datapackage "$qsv_bin" to datapackage benchmark_work.json "$data"
|
|
0 commit comments