2022-08-05 11:18:25 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-11-21 19:42:14 +00:00
|
|
|
echo Compiling with cargo...
|
|
|
|
cargo build --release
|
|
|
|
echo Copying to $HOME/.local/bin
|
2022-08-05 11:24:30 +00:00
|
|
|
mkdir -p $HOME/.local/bin/
|
2021-11-21 19:42:14 +00:00
|
|
|
cp target/release/fsh $HOME/.local/bin/
|
|
|
|
|
2022-08-05 11:18:25 +00:00
|
|
|
enable_hostname="0"
|
|
|
|
|
|
|
|
while getopts "h" FLAG
|
|
|
|
do
|
|
|
|
case "${FLAG}" in
|
|
|
|
h) enable_hostname="1";;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2021-11-21 19:42:14 +00:00
|
|
|
if [ ! -f $HOME/.config/fish/functions/fish_prompt.fish ]; then
|
2022-08-05 11:24:30 +00:00
|
|
|
mkdir -p $HOME/.config/fish/functions/
|
2022-08-05 11:18:25 +00:00
|
|
|
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
|
2021-11-21 19:42:14 +00:00
|
|
|
set FSH_LAST_STATUS \$status
|
2022-08-05 11:18:25 +00:00
|
|
|
set -x FSH_NO_HOSTNAME 1
|
2021-11-30 21:26:12 +00:00
|
|
|
fsh \$FSH_LAST_STATUS
|
2021-11-21 19:42:14 +00:00
|
|
|
end" > $HOME/.config/fish/functions/fish_prompt.fish
|
2022-08-05 11:18:25 +00:00
|
|
|
fi
|
2021-11-21 19:42:14 +00:00
|
|
|
fi
|