remote/bootstrap.sh @ 5ba3d8d1eef5

More
author Steve Losh <steve@stevelosh.com>
date Fri, 17 Jan 2020 21:25:07 -0500
parents (none)
children c29a6ab95e91
#!/usr/bin/env bash

set -euo pipefail

function ensure_link {
    src="$HOME/$1"
    dst="$HOME/$2"
    if test -L "$dst"; then
        # Already linked.
        true
    elif test -e "$dst"; then
        echo File "$dst" already exists and is not a symbolic link.
        exit 1
    elif test ! -e "$src"; then
        echo File "$src" does not exist.
        exit 1
    else
        echo "Linking $src into $dst"
        ln -s "$src" "$dst"
    fi
}

mkdir -p ~/.config/fish
mkdir -p ~/.config/nvim
mkdir -p ~/bin

ensure_link "src/dotfiles/gitconfig"     ".gitconfig"
ensure_link "src/dotfiles/gitignore"     ".gitignore"
ensure_link "src/dotfiles/bash_profile"  ".bash_profile"
ensure_link "src/dotfiles/dircolors"     ".dircolors"
ensure_link "src/dotfiles/ffignore"      ".ffignore"
ensure_link "src/dotfiles/config.fish"   ".config/fish/config.fish"
ensure_link "src/dotfiles/tmux.conf"     ".tmux.conf"
# ensure_link "src/dotfiles/vim"           ".vim"
# ensure_link "src/dotfiles/vimrc"         ".vimrc"