2020-04-21 12:39:18 -04:00
|
|
|
#!/bin/bash
|
2021-10-06 09:40:58 -04:00
|
|
|
|
2023-08-26 00:31:52 -04:00
|
|
|
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
|
|
FAKE_HOME="$SCRIPT_DIR/fake_home"
|
2021-10-06 12:47:19 -04:00
|
|
|
|
2024-01-08 17:53:16 -05:00
|
|
|
if ! command -v wget &> /dev/null; then
|
|
|
|
echo "wget must be installed!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-09-27 12:14:06 -04:00
|
|
|
git submodule init
|
|
|
|
git submodule update
|
2021-10-06 12:47:19 -04:00
|
|
|
|
2023-08-26 00:31:52 -04:00
|
|
|
dotdirs="$(find $FAKE_HOME -mindepth 1 -type d)"
|
2021-10-06 13:01:46 -04:00
|
|
|
|
2023-08-26 00:31:52 -04:00
|
|
|
echo "$dotdirs" | while read -r dotdir; do
|
|
|
|
new="$HOME${dotdir:${#FAKE_HOME}}"
|
|
|
|
echo "mkdir -p $new"
|
|
|
|
mkdir -p $new
|
|
|
|
done
|
2021-10-07 11:29:19 -04:00
|
|
|
|
2021-10-06 13:32:36 -04:00
|
|
|
|
2023-08-26 00:31:52 -04:00
|
|
|
dotfiles="$(find $FAKE_HOME -mindepth 1 -type f)"
|
2021-10-06 13:50:04 -04:00
|
|
|
|
2023-08-26 00:31:52 -04: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
|
|
|
|
2023-12-13 15:09:02 -05:00
|
|
|
if ! grep DOT_DIR $HOME/.zsh_local; then
|
|
|
|
echo "export DOT_DIR=\"$SCRIPT_DIR\"" >> $HOME/.zsh_local
|
|
|
|
fi
|
|
|
|
|
2023-08-26 00:31:52 -04:00
|
|
|
if [[ "$1" == "--files-only" ]]; then
|
2023-08-26 00:28:19 -04:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2023-08-26 00:44:39 -04:00
|
|
|
echo
|
|
|
|
echo "Installing required packages..."
|
|
|
|
|
2023-08-26 00:28:19 -04:00
|
|
|
echo -n "Rust is "
|
2023-08-26 00:44:39 -04:00
|
|
|
if ! command -v cargo &> /dev/null; then
|
2023-08-26 00:28:19 -04:00
|
|
|
echo "not installed. Installing..."
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
|
|
else
|
|
|
|
echo "already installed."
|
|
|
|
fi
|
|
|
|
|
|
|
|
. "$HOME/.cargo/env"
|
2023-08-26 00:44:39 -04:00
|
|
|
if command -v cargo &> /dev/null && ! command -v bat &> /dev/null; then
|
2023-08-26 00:28:19 -04:00
|
|
|
cargo install bat
|
|
|
|
fi
|
|
|
|
|
2023-08-26 00:44:39 -04:00
|
|
|
echo -n "nvm is "
|
2023-08-26 00:28:19 -04:00
|
|
|
if ! test -d "$HOME/.nvm"; then
|
|
|
|
echo "not installed. Installing..."
|
|
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
|
|
|
|
export NVM_DIR="$HOME/.nvm"
|
|
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
|
|
nvm install 14
|
|
|
|
nvm install 18
|
|
|
|
nvm install node
|
|
|
|
nvm use node
|
2022-12-03 00:56:43 -05:00
|
|
|
else
|
2023-08-26 00:28:19 -04:00
|
|
|
echo "already installed."
|
2021-10-06 13:32:36 -04:00
|
|
|
fi
|
2023-08-26 00:28:19 -04:00
|
|
|
|
2023-08-26 00:44:39 -04:00
|
|
|
echo -n "dotnet is "
|
|
|
|
if ! command -v dotnet &> /dev/null; then
|
2023-08-26 00:28:19 -04:00
|
|
|
echo "not installed. Installing..."
|
|
|
|
wget https://dot.net/v1/dotnet-install.sh -O /tmp/dotnet-install.sh
|
|
|
|
chmod +x /tmp/dotnet-install.sh
|
|
|
|
/tmp/dotnet-install.sh --version latest
|
|
|
|
rm /tmp/dotnet-install.sh
|
|
|
|
else
|
|
|
|
echo "already installed."
|
|
|
|
fi
|
|
|
|
|
2023-08-26 00:44:39 -04:00
|
|
|
echo -n "starship is "
|
|
|
|
if ! command -v starship &> /dev/null; then
|
2023-08-26 00:28:19 -04:00
|
|
|
echo "not installed. Installing..."
|
2023-12-13 14:00:47 -05:00
|
|
|
curl -sS https://starship.rs/install.sh | sh
|
|
|
|
echo "Starship requires an NFont: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip"
|
2023-08-26 00:28:19 -04:00
|
|
|
else
|
|
|
|
echo "already installed."
|
|
|
|
fi
|
|
|
|
|
2023-08-26 00:44:39 -04:00
|
|
|
echo -n "JetBrains toolbox is "
|
|
|
|
if ! test -d $HOME/.config/JetBrains/; then
|
2023-08-26 00:41:41 -04:00
|
|
|
echo "not installed. Installing..."
|
|
|
|
ARCHIVE_URL="$(curl -s 'https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release' | grep -Po '"linux":.*?[^\\]",' | awk -F ':' '{print $3,":"$4}'| sed 's/[", ]//g')"
|
|
|
|
wget -q --show-progress -cO "/tmp/jetbrains-toolbox-latest.tar.gz" "$ARCHIVE_URL"
|
|
|
|
cd /tmp/
|
|
|
|
tar -xvf jetbrains-toolbox-latest.tar.gz --strip-components=1
|
|
|
|
chmod +x jetbrains-toolbox
|
|
|
|
./jetbrains-toolbox
|
|
|
|
else
|
|
|
|
echo "already installed."
|
|
|
|
fi
|
|
|
|
|
2023-08-26 00:44:39 -04:00
|
|
|
if ! command -v fzf &> /dev/null; then
|
|
|
|
echo "You may wish to install fzf for sofi and other search"
|
2022-12-03 00:56:43 -05:00
|
|
|
else
|
2023-08-26 00:45:26 -04:00
|
|
|
echo "fzf is already installed"
|
2021-10-06 13:32:36 -04:00
|
|
|
fi
|