From b6d55711e3340a2bed34101b61b379ce72dd7ccd Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Tue, 26 Mar 2024 21:36:22 +0100 Subject: [PATCH] Warn in installation shell script if using an unknown shell --- scripts/install.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 16fedb0..45c3388 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -14,6 +14,16 @@ if ! command -v unzip >/dev/null 2>&1; then exit 1 fi +# Warn the user if they are not using a shell we know works (bash, zsh) +if [ -z "$BASH_VERSION" ] && [ -z "$ZSH_VERSION" ]; then + echo "WARNING: You are using an unsupported shell. Automatic installation may not work correctly." >&2 +fi + +# Let the user know their access token was detected, if provided +if [ ! -z "$GITHUB_PAT" ]; then + echo "NOTE: Using provided GITHUB_PAT for authentication" +fi + # Determine OS and architecture for the current system OS="$(uname -s | tr '[:upper:]' '[:lower:]')" case "$OS" in @@ -35,10 +45,6 @@ case "$ARCH" in exit 1 ;; esac -if [ ! -z "$GITHUB_PAT" ]; then - echo "NOTE: Using provided GITHUB_PAT for authentication" -fi - # Construct file pattern for our desired zip file based on OS + arch # NOTE: This only works for exact patterns "binary-X.Y.Z-os-arch.zip" # and WILL break if the version contains extra metadata / pre-release