From 9d02d1d767b075221031be19ad9695f1259b3519 Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Wed, 18 Feb 2026 18:32:45 -0800 Subject: [PATCH] install: prevent partial download script execution (#14311) Wrap script in main function so that a truncated partial download doesn't end up executing half a script. --- scripts/install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index 22b89d377..8bff7e2f4 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,6 +2,10 @@ # This script installs Ollama on Linux and macOS. # It detects the current operating system architecture and installs the appropriate version of Ollama. +# Wrap script in main function so that a truncated partial download doesn't end +# up executing half a script. +main() { + set -eu red="$( (/usr/bin/tput bold || :; /usr/bin/tput setaf 1 || :) 2>&-)" @@ -446,3 +450,6 @@ fi status "NVIDIA GPU ready." install_success +} + +main