From d58d8582d813c3ec99eb3215061fb445862e5fbe Mon Sep 17 00:00:00 2001 From: Rohit T P Date: Fri, 19 Apr 2024 16:56:56 +0000 Subject: [PATCH] fix: fixed nproc not available on mac --- docker-compose/setup-script/noco.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docker-compose/setup-script/noco.sh b/docker-compose/setup-script/noco.sh index 4a05d009ad..0d9eeb6766 100755 --- a/docker-compose/setup-script/noco.sh +++ b/docker-compose/setup-script/noco.sh @@ -252,7 +252,7 @@ echo "Show Advanced Options [Y/N] (default: N): " read -r ADVANCED_OPTIONS if [ -n "$ADVANCED_OPTIONS" ] && { [ "$ADVANCED_OPTIONS" = "Y" ] || [ "$ADVANCED_OPTIONS" = "y" ]; }; then - NUM_CORES=$(nproc) + NUM_CORES=$(nproc || sysctl -n hw.ncpu || echo 1) echo "How many instances of NocoDB do you want to run (Maximum: ${NUM_CORES}) ? (default: 1): " NUM_INSTANCES=$(read_number_range 1 "$NUM_CORES") @@ -640,9 +640,7 @@ show_logs() { elif [ "\$log_choice" == "A" ] || [ "\$log_choice" == "a" ]; then trap 'show_logs' INT $DOCKER_COMMAND compose logs -f - elif [ "\$log_choice" == "0" ]; then - return - else + elif [ "\$log_choice" != "0" ]; then show_logs fi @@ -665,7 +663,7 @@ upgrade_service() { # Function to scale the service scale_service() { - num_cores=\$(nproc) + num_cores=\$(nproc || sysctl -n hw.ncpu || echo 1) current_scale=\$($DOCKER_COMMAND compose ps -q nocodb | wc -l) echo -e "\nCurrent number of instances: \$current_scale" echo "How many instances of NocoDB do you want to run (Maximum: \${num_cores}) ? (default: 1): "