From 53ac8532e43058957394c34189dc46c309262b61 Mon Sep 17 00:00:00 2001 From: Dalton Flanagan <6599399+dltn@users.noreply.github.com> Date: Tue, 17 Jun 2025 03:33:28 -0400 Subject: [PATCH] fix: clarify bash requirement in install flow (#2450) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What does this PR do? Our "run this line to get started" pipes into `sh`, but the default shell on Ubuntu (a common setup) is `dash`, which doesn't support `pipefail`: ``` dalton@ollama-test:~$ ls -l /usr/bin/sh lrwxrwxrwx 1 root root 4 Mar 31 2024 /usr/bin/sh -> dash ``` ``` $ curl -LsSf https://github.com/meta-llama/llama-stack/raw/main/install.sh | sh sh: 8: set: Illegal option -o pipefail ``` Let's be explicit with `bash`? It covers Linux, WSL, macOS and I doubt anyone's trying to run Llama Stack on embedded systems :) ## Test Plan ``` dalton@ollama-test:~/llama-stack$ cat install.sh | sh This script must be run with bash dalton@ollama-test:~/llama-stack$ cat install.sh | bash ❌ Docker or Podman is required. Install Docker: https://docs.docker.com/get-docker/ or Podman: https://podman.io/getting-started/installation ``` --- README.md | 2 +- install.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 37f1aa0f3..7f34c3340 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ As more providers start supporting Llama 4, you can use them in Llama Stack as w To try Llama Stack locally, run: ```bash -curl -LsSf https://github.com/meta-llama/llama-stack/raw/main/install.sh | sh +curl -LsSf https://github.com/meta-llama/llama-stack/raw/main/install.sh | bash ``` ### Overview diff --git a/install.sh b/install.sh index e424925a6..dae43df38 100755 --- a/install.sh +++ b/install.sh @@ -5,6 +5,11 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. +[ -z "$BASH_VERSION" ] && { + echo "This script must be run with bash" >&2 + exit 1 +} + set -Eeuo pipefail PORT=8321