From 2c91051dbf9db43f014bf34971e22fa00df58bf4 Mon Sep 17 00:00:00 2001 From: ADoyle Date: Thu, 13 Jul 2023 09:35:37 +0800 Subject: [PATCH] fix: reuse local geekbench, do not download it (#68) --- yabs.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/yabs.sh b/yabs.sh index 84d6d3e..f16e656 100644 --- a/yabs.sh +++ b/yabs.sh @@ -894,8 +894,13 @@ function launch_geekbench { if [[ $GB_RUN == *True* ]]; then # run GB test echo -en "\nRunning GB$VERSION benchmark test... *cue elevator music*" - # download the desired Geekbench tarball and extract to geekbench temp directory - $DL_CMD $GB_URL | tar xz --strip-components=1 -C $GEEKBENCH_PATH &>/dev/null + # check for local geekbench installed + if command -v "$GB_CMD" &>/dev/null; then + GEEKBENCH_PATH=$(dirname "$(command -v "$GB_CMD")") + else + # download the desired Geekbench tarball and extract to geekbench temp directory + $DL_CMD $GB_URL | tar xz --strip-components=1 -C $GEEKBENCH_PATH &>/dev/null + fi # unlock if license file detected test -f "geekbench.license" && $GEEKBENCH_PATH/$GB_CMD --unlock $(cat geekbench.license) > /dev/null 2>&1