fsh/setup.sh

32 lines
848 B
Bash
Executable File

#!/usr/bin/env bash
echo Compiling with cargo...
cargo build --release
echo Copying to $HOME/.local/bin
cp target/release/fsh $HOME/.local/bin/
enable_hostname="0"
while getopts "h" FLAG
do
case "${FLAG}" in
h) enable_hostname="1";;
esac
done
if [ ! -f $HOME/.config/fish/functions/fish_prompt.fish ]; then
if [ $enable_hostname = "1" ]; then
echo "Creating $HOME/.config/fish/functions/fish_prompt.fish"
echo "function fish_prompt
set FSH_LAST_STATUS \$status
fsh \$FSH_LAST_STATUS
end" > $HOME/.config/fish/functions/fish_prompt.fish
else
echo "Creating $HOME/.config/fish/functions/fish_prompt.fish"
echo "function fish_prompt
set FSH_LAST_STATUS \$status
set -x FSH_NO_HOSTNAME 1
fsh \$FSH_LAST_STATUS
end" > $HOME/.config/fish/functions/fish_prompt.fish
fi
fi