# HG changeset patch # User Steve Losh # Date 1579197180 18000 # Node ID 495491e3e5892c18be166262439ce9d5d99bd011 # Parent 22b96790d57c4d62be4f5bdfdcbe9b6bd5ce515d More diff -r 22b96790d57c -r 495491e3e589 bin/bootstrap.sh --- a/bin/bootstrap.sh Thu Jan 16 12:49:06 2020 -0500 +++ b/bin/bootstrap.sh Thu Jan 16 12:53:00 2020 -0500 @@ -1,8 +1,6 @@ #!/bin/bash -# THIS IS A WORK IN PROGRESS -# BE CAREFUL, DAMMIT -set -e +set -euo pipefail function ensure_link { test -L "$HOME/$2" || test ! -e "$HOME/$1" || ln -s "$HOME/$1" "$HOME/$2" @@ -24,7 +22,7 @@ ensure_link "src/dulwich/dulwich" "src/hg/dulwich" -test -d ~/src/dotfiles || hg clone http://bitbucket.org/sjl/dotfiles ~/src/dotfiles +test -d ~/src/dotfiles || hg clone https://hg.stevelosh.com/dotfiles ~/src/dotfiles ensure_link "src/dotfiles/Xmodmap" ".Xmodmap" ensure_link "src/dotfiles/abclrc" ".abclrc" diff -r 22b96790d57c -r 495491e3e589 servers/bin/bootstrap.sh --- a/servers/bin/bootstrap.sh Thu Jan 16 12:49:06 2020 -0500 +++ b/servers/bin/bootstrap.sh Thu Jan 16 12:53:00 2020 -0500 @@ -1,10 +1,26 @@ #!/usr/bin/env bash -function make_link() { - test -e "$HOME/$2" || ln -s "$HOME/dotfiles/$1" "$HOME/$2" +set -euo pipefail + +function ensure_link { + test -L "$HOME/$2" || test ! -e "$HOME/$1" || ln -s "$HOME/$1" "$HOME/$2" } -eval "$(dircolors -b ~/.dircolors)" +mkdir -p ~/.config/fish +mkdir -p ~/.config/nvim +mkdir -p ~/src/hg +mkdir -p ~/bin +mkdir -p ~/src -make_link bash_profile .bash_profile -make_link dircolors .dircolors +ensure_link "src/dotfiles/hgrc" ".hgrc" +ensure_link "src/dotfiles/bash_profile" ".bash_profile" +ensure_link "src/dotfiles/dircolors" ".dircolors" +ensure_link "src/dotfiles/ffignore" ".ffignore" +ensure_link "src/dotfiles/fish/config.fish" ".config/fish/config.fish" +ensure_link "src/dotfiles/fish/functions" ".config/fish/functions" +ensure_link "src/dotfiles/gitconfig" ".gitconfig" +ensure_link "src/dotfiles/gitignore" ".gitignore" +ensure_link "src/dotfiles/hgignore" ".hgignore" +ensure_link "src/dotfiles/tmux/tmux.conf" ".tmux.conf" +ensure_link "src/dotfiles/vim" ".vim" +ensure_link "src/dotfiles/vim/vimrc" ".vimrc"