remote/bootstrap.sh @ 96d5ea1b6097

More
author Steve Losh <steve@stevelosh.com>
date Fri, 03 Nov 2023 11:11:00 -0400
parents e7338d0c9900
children 2e85350afef8
#!/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, skipping.
    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
mkdir -p ~/.vim
mkdir -p ~/.terminfo/s

ensure_link "src/dotfiles/st"            ".terminfo/s/st"
ensure_link "src/dotfiles/st-256color"   ".terminfo/s/st-256color"
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/hushlogin"     ".hushlogin"
ensure_link "src/dotfiles/vimrc"         ".vimrc"
ensure_link "src/dotfiles/vim-colors"    ".vim/colors"
ensure_link "src/dotfiles/vimrc-remote-local" ".vimrc_remote_local"