Skip to content

Commit

Permalink
Warn in installation shell script if using an unknown shell
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Mar 26, 2024
1 parent b3bf5ed commit b6d5571
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b6d5571

Please sign in to comment.