2020-04-21 12:39:18 -04:00
|
|
|
#!/bin/bash
|
2021-10-06 09:40:58 -04:00
|
|
|
|
2022-12-03 00:56:43 -05:00
|
|
|
# Install required packages
|
|
|
|
if [[ "$1" != "--install" ]]; then
|
|
|
|
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
|
|
FAKE_HOME="$SCRIPT_DIR/fake_home"
|
2021-10-06 12:47:19 -04:00
|
|
|
|
2022-12-03 00:56:43 -05:00
|
|
|
dotdirs="$(find $FAKE_HOME -mindepth 1 -type d)"
|
2021-10-06 12:47:19 -04:00
|
|
|
|
2022-12-03 00:56:43 -05:00
|
|
|
echo "$dotdirs" | while read -r dotdir; do
|
|
|
|
new="$HOME${dotdir:${#FAKE_HOME}}"
|
|
|
|
echo "mkdir -p $new"
|
|
|
|
mkdir -p $new
|
|
|
|
done
|
2021-10-06 13:01:46 -04:00
|
|
|
|
2021-10-07 11:29:19 -04:00
|
|
|
|
2022-12-03 00:56:43 -05:00
|
|
|
dotfiles="$(find $FAKE_HOME -mindepth 1 -type f)"
|
2021-10-06 13:32:36 -04:00
|
|
|
|
2022-12-03 00:56:43 -05:00
|
|
|
echo "$dotfiles" | while read -r dotfile; do
|
|
|
|
new="$HOME${dotfile:${#FAKE_HOME}}"
|
|
|
|
echo "$dotfile => $new"
|
|
|
|
ln -sf "$dotfile" "$new"
|
|
|
|
done
|
2021-10-06 13:50:04 -04:00
|
|
|
|
2022-12-03 00:56:43 -05:00
|
|
|
touch "$HOME/.zsh_local"
|
|
|
|
else
|
2021-10-06 13:32:36 -04:00
|
|
|
echo -n "Rust is "
|
2021-10-06 19:16:02 -04:00
|
|
|
if ! command -v cargo; then
|
2021-10-06 13:32:36 -04:00
|
|
|
echo "not installed. Installing..."
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
|
|
else
|
|
|
|
echo "installed."
|
|
|
|
fi
|
|
|
|
. "$HOME/.cargo/env"
|
2021-10-06 19:16:02 -04:00
|
|
|
if command -v cargo; then
|
2021-10-06 13:32:36 -04:00
|
|
|
cargo install bat
|
|
|
|
fi
|
2022-10-17 22:35:06 -04:00
|
|
|
curl -sS https://starship.rs/install.sh | sh
|
2021-10-06 13:32:36 -04:00
|
|
|
echo "Starship requires an NFont: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip"
|
|
|
|
echo "You may wish to install fzf"
|
|
|
|
fi
|