mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
80 lines
2.3 KiB
Bash
80 lines
2.3 KiB
Bash
#!/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/Brewfile" "/Users/ivuorinen/.Brewfile"
|
|
handle_file_ln "/Users/ivuorinen/.dotfiles/alias" "/Users/ivuorinen/.alias"
|
|
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/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/git_profiles" "/Users/ivuorinen/.git_profiles"
|
|
handle_file_ln "/Users/ivuorinen/.dotfiles/huskyrc" "/Users/ivuorinen/.huskyrc"
|
|
handle_file_ln "/Users/ivuorinen/.dotfiles/install.sh" "/Users/ivuorinen/.install.sh"
|
|
handle_file_ln "/Users/ivuorinen/.dotfiles/local/bin/x-open-ports" "/Users/ivuorinen/.local/bin/x-open-ports"
|
|
handle_file_ln "/Users/ivuorinen/.dotfiles/vuerc" "/Users/ivuorinen/.vuerc"
|
|
handle_file_ln "/Users/ivuorinen/.dotfiles/zshrc" "/Users/ivuorinen/.zshrc"
|