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.
This commit is contained in:
Bruce MacDonald
2026-02-18 18:32:45 -08:00
committed by GitHub
parent 1a636fb47a
commit 9d02d1d767

View File

@@ -2,6 +2,10 @@
# This script installs Ollama on Linux and macOS. # This script installs Ollama on Linux and macOS.
# It detects the current operating system architecture and installs the appropriate version of Ollama. # 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 set -eu
red="$( (/usr/bin/tput bold || :; /usr/bin/tput setaf 1 || :) 2>&-)" red="$( (/usr/bin/tput bold || :; /usr/bin/tput setaf 1 || :) 2>&-)"
@@ -446,3 +450,6 @@ fi
status "NVIDIA GPU ready." status "NVIDIA GPU ready."
install_success install_success
}
main