Something went wrong. Try again.
🏠 sweet ~/
Something went wrong. Try again.
2.7 kB · 107 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108#!/bin/bash
set -e
un="$(uname)"case "${un}" in Linux) ostype=linux homebrew_prefix_default=/home/linuxbrew/.linuxbrew ;; Darwin) ostype=macos if [[ "$(uname -m)" == "arm64" ]] then homebrew_prefix_default=/opt/homebrew else homebrew_prefix_default=/usr/local fiesac
# Install homebrew if it doesn't existif [[ ! -d "${homebrew_prefix_default}" ]]then CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"fi
if [ -n $CODESPACES ]then # Codespaces has a .gitconfig already setup, but in order to take advantage of # the attributes set in /etc/gitconfig we have to explicitly include the path. git config --global include.path /etc/gitconfig
dotfiles_dir="$(pwd -P)"
# Symlink all of the dotfiles to the $HOME directory for dotfile in .*; do # Skip . and .. directories echo $dotfile | egrep -q '^(\.+)$' && continue source="$dotfiles_dir/$dotfile" destination="$HOME/$dotfile"
# If the directory already exists in the $HOME directory then we'll # just symlink the contents rather than the directory itself. # Basically this is just ~/.config if [ -d $destination ] && ! [ -L $destination ] then for file in $source/* do ln -sfv "$file" "$destination" done continue fi
[ -d $dotfile ] && dotfile="$dotfile/"
if [ -L $destination ] && [ -d $dotfile ] then ln -sfv "$source" "$destination" else rm -rv "$destination" 2>/dev/null ln -sv "$source" "$destination" fi done
# Bring in all of our submodule dependencies git submodule update --recursive --initelif [ ! -d $HOME/.dotfiles ]then # https://www.atlassian.com/git/tutorials/dotfiles git clone --bare https://github.com/tarebyte/dotfiles.git $HOME/.dotfiles
function dconfig { /usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@ }
dconfig checkout dconfig status.showUntrackedFiles no
# Bring in all of our submodule dependencies dconfig submodule update --recursive --initfi
alias brew="$homebrew_prefix_default/bin/brew"brew bundle --file $HOME/.homebrew/Brewfile
if [ "${ostype}" == macos ]then brew bundle --file $HOME/.homebrew/Brewfile.darwinfi
homebrew_fish_path="${homebrew_prefix_default}/bin/fish"alias fish=$homebrew_fish_path
echo $homebrew_fish_path | sudo tee -a /etc/shellschsh -s $homebrew_fish_path
# Install fisher pluginsecho "curl -sL https://git.io/fisher | source && fisher update" | fish
# Set the themeecho "base16-ocean" | fish
# Install Neovim packages via packerecho "nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'" | fish
echo "All set!"