Ensure that your tools are installed with Bash

checkTool() {
    echo "Checking if $1 is installed..."
    # evaluate check command and check its exit code
    if eval "$2"; then
        echo "Success! $1 is installed."
    else
        echo "Error: $1 is not installed properly!"
    fi
    echo
}

checkKernel() {
    echo "Checking if the $1 Jupyter kernel is installed..."
    # check if kernel is listed in current kernelspec
    if jupyter kernelspec list | grep --color=never "$1"; then
        echo "Success! the $1 Jupyter kernel is installed."
    else
        echo "Error: the $1 Jupyter kernel is not installed properly!"
    fi
    echo
}

checkTool "conda"   "conda --version"
checkTool "jupyter" "conda list | grep jupyter | head -n 1"

checkKernel "bash"
checkKernel "javascript"
checkKernel "python"
Checking if conda is installed...
conda 4.13.0
Success! conda is installed.

Checking if jupyter is installed...
jupyter                   1.0.0            py39h06a4308_7  
Success! jupyter is installed.

Checking if the bash Jupyter kernel is installed...
  bash          /home/user/.local/share/jupyter/kernels/bash
Success! the bash Jupyter kernel is installed.

Checking if the javascript Jupyter kernel is installed...
  javascript    /home/user/.local/share/jupyter/kernels/javascript
Success! the javascript Jupyter kernel is installed.

Checking if the python Jupyter kernel is installed...
  python3       /home/user/anaconda3/share/jupyter/kernels/python3
Success! the python Jupyter kernel is installed.

Updating a repository with Bash

# change into a git-initialized directory
cd /home/user/projects/apcsp || exit

# pull from remote
git pull

# stage files for comitting
git add .

# commit with a message
git commit -m "feat: added stuff"

# push changes to remote origin on branch master
git push origin master

Automating Jupyter & Jupyter kernel installation

failedto() {
    echo "Failed to $1. Please manually debug any errors printed to STDERR."
    exit
}

if ! jupyter &>/dev/null; then
    failedto "ensure that Jupyter was installed"
fi

{
    echo "Installing Jupyter bash kernel..."
    pip install bash_kernel
    python -m bash_kernel.install
} || failedto "install bash kernel"

{
    echo "Installing Jupyter node kernel..."
    npm install --global ijavascript
    ijsinstall
} || failedto "install node kernel"

echo "Both the bash and javascript (via NodeJS) kernels have been installed!"