#!/bin/bash
 
# Script for installing Fish Shell on systems without root access.
# Fish Shell will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
 
# exit on error
set -e
 
FISH_SHELL_VERSION=3.7.1
 
# create our directories
mkdir -p $HOME/local $HOME/fish_shell_tmp
cd $HOME/fish_shell_tmp
 
# download source files for Fish Shell
wget https://github.com/fish-shell/fish-shell/releases/download/$FISH_SHELL_VERSION/fish-$FISH_SHELL_VERSION.tar.xz
 
# extract files, configure, and compile

tar xvJf fish-${FISH_SHELL_VERSION}.tar.xz
mkdir fish-${FISH_SHELL_VERSION}/build
cd fish-${FISH_SHELL_VERSION}/build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
make
make install
