#!/bin/sh # # Usage: # # sh install.sh # # Environment variables: VERBOSE, CP, LN, MKDIR, RM, DIRNAME. # # env VERBOSE=1 sh install.sh # # DO NOT EDIT THIS FILE # # This file is generated by rcm(7) as: # # rcup -B 0 -g # # To update it, re-run the above command. # : ${VERBOSE:=0} : ${CP:=/bin/cp} : ${LN:=/bin/ln} : ${MKDIR:=/bin/mkdir} : ${RM:=/bin/rm} : ${DIRNAME:=/usr/bin/dirname} verbose() { if [ "$VERBOSE" -gt 0 ]; then echo "$@" fi } handle_file_cp() { if [ -e "$2" ]; then printf "%s " "overwrite $2? [yN]" read overwrite case "$overwrite" in y) $RM -rf "$2" ;; *) echo "skipping $2" return ;; esac fi verbose "'$1' -> '$2'" $MKDIR -p "$($DIRNAME "$2")" $CP -R "$1" "$2" } handle_file_ln() { if [ -e "$2" ]; then printf "%s " "overwrite $2? [yN]" read overwrite case "$overwrite" in y) $RM -rf "$2" ;; *) echo "skipping $2" return ;; esac fi verbose "'$1' -> '$2'" $MKDIR -p "$($DIRNAME "$2")" $LN -sf "$1" "$2" } handle_file_ln "/Users/ivuorinen/.dotfiles/bash_profile" "/Users/ivuorinen/.bash_profile" handle_file_ln "/Users/ivuorinen/.dotfiles/bashrc" "/Users/ivuorinen/.bashrc" handle_file_ln "/Users/ivuorinen/.dotfiles/config/alias" "/Users/ivuorinen/.config/alias" handle_file_ln "/Users/ivuorinen/.dotfiles/config/antigen.zsh" "/Users/ivuorinen/.config/antigen.zsh" handle_file_ln "/Users/ivuorinen/.dotfiles/config/gh/config.yml" "/Users/ivuorinen/.config/gh/config.yml" handle_file_ln "/Users/ivuorinen/.dotfiles/config/git/config" "/Users/ivuorinen/.config/git/config" handle_file_ln "/Users/ivuorinen/.dotfiles/config/git/gitignore" "/Users/ivuorinen/.config/git/gitignore" handle_file_ln "/Users/ivuorinen/.dotfiles/config/wtf/config.yml" "/Users/ivuorinen/.config/wtf/config.yml" handle_file_ln "/Users/ivuorinen/.dotfiles/git_profiles" "/Users/ivuorinen/.git_profiles" handle_file_ln "/Users/ivuorinen/.dotfiles/huskyrc" "/Users/ivuorinen/.huskyrc" handle_file_ln "/Users/ivuorinen/.dotfiles/local/bin/x-open-ports" "/Users/ivuorinen/.local/bin/x-open-ports" handle_file_ln "/Users/ivuorinen/.dotfiles/rcrc" "/Users/ivuorinen/.rcrc" handle_file_ln "/Users/ivuorinen/.dotfiles/ssh/allowed_signers" "/Users/ivuorinen/.ssh/allowed_signers" handle_file_ln "/Users/ivuorinen/.dotfiles/ssh/config" "/Users/ivuorinen/.ssh/config" handle_file_ln "/Users/ivuorinen/.dotfiles/vuerc" "/Users/ivuorinen/.vuerc" handle_file_ln "/Users/ivuorinen/.dotfiles/zshrc" "/Users/ivuorinen/.zshrc"