Add a check to skip `cmatrix` installation if running in a GitHub Codespace. * **Check for GitHub Codespace**: Add a check for the `CODESPACES` environment variable at the beginning of the script. * **Skip Installation**: Skip the installation of `cmatrix` if the `CODESPACES` environment variable is set. * **Informative Message**: Add a message indicating that the installation is being skipped due to running in a GitHub Codespace.
20 lines
544 B
Bash
20 lines
544 B
Bash
#!/usr/bin/env bash
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Description:
|
|
# Install cmatrix.
|
|
#
|
|
|
|
# Check if running in a GitHub Codespace
|
|
if [ -n "$CODESPACES" ]; then
|
|
echo "Skipping cmatrix installation: Running in a GitHub Codespace"
|
|
else
|
|
if ! command -v "cmatrix" &>/dev/null; then
|
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|
sudo apt-get install -qq cmatrix &>/dev/null
|
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
|
brew install cmatrix
|
|
fi
|
|
fi
|
|
fi
|