mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
rcm install script
env RCRC=/dev/null rcup -B 0 -g > install.sh
This commit is contained in:
77
install.sh
Normal file
77
install.sh
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/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/gitconfig" "/Users/ivuorinen/.gitconfig"
|
||||
handle_file_ln "/Users/ivuorinen/.dotfiles/gitignore_global" "/Users/ivuorinen/.gitignore_global"
|
||||
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/vuerc" "/Users/ivuorinen/.vuerc"
|
||||
handle_file_ln "/Users/ivuorinen/.dotfiles/zshrc" "/Users/ivuorinen/.zshrc"
|
||||
Reference in New Issue
Block a user