From 9e6dec0bc4c0790f719ae4895a13a0cf90c6b6d3 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 24 Jun 2024 18:21:20 +0200 Subject: [PATCH] fix(install.sh): not all systems have nproc Signed-off-by: Ettore Di Giacinto --- docs/static/install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/static/install.sh b/docs/static/install.sh index 8824486e..4efdc757 100644 --- a/docs/static/install.sh +++ b/docs/static/install.sh @@ -77,8 +77,11 @@ USE_AIO=${USE_AIO:-false} API_KEY=${API_KEY:-} CORE_IMAGES=${CORE_IMAGES:-false} # nprocs -1 -procs=$(nproc) -procs=$((procs-1)) +if available nproc; then + procs=$(nproc) +else + procs=1 +fi THREADS=${THREADS:-$procs} LATEST_VERSION=$(curl -s "https://api.github.com/repos/mudler/LocalAI/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') VERSION="${VERSION:-$LATEST_VERSION}"