dotfiles/bin/install.sh

83 lines
2.9 KiB
Bash
Raw Normal View History

2016-10-14 21:59:34 +02:00
#!/usr/bin/env bash
2012-06-18 01:10:31 +02:00
#
# creates symlinks from the home directory to
2012-06-18 01:10:31 +02:00
# any desired dotfiles in ~/dotfiles
#
2012-06-18 01:10:31 +02:00
# adapted from @michaeljsmalley
# https://github.com/michaeljsmalley/dotfiles/blob/master/makesymlinks.sh
########################################################################
2017-05-21 00:59:35 +02:00
set e
2012-06-18 01:10:31 +02:00
# ----------------------------------------------------------------------
# Variables
# ----------------------------------------------------------------------
# dotfiles directory
2017-06-12 01:21:12 +02:00
cd ../ || exit
2014-11-03 17:40:13 +01:00
2012-06-18 01:10:31 +02:00
# list of files/folders to symlink in homedir
2017-05-07 01:20:00 +02:00
files="aliases bashrc bash_profile bash_paths bash_prompt exports gemrc gitconfig gitignore hushlogin inputrc private npmrc bin tmux.conf"
2014-11-03 17:40:13 +01:00
2017-05-21 00:59:35 +02:00
# ----------------------------------------------------------------------
# create the private file first, will be symlinked but ignored by git
# ----------------------------------------------------------------------
touch private
2012-06-18 01:10:31 +02:00
# ----------------------------------------------------------------------
2014-11-03 17:40:13 +01:00
# create symlinks from the homedir to any files in the dotfiles directory
2012-06-18 01:10:31 +02:00
# specified in $files
# ----------------------------------------------------------------------
2014-11-03 17:40:13 +01:00
2012-06-18 01:10:31 +02:00
for file in $files; do
2017-06-12 01:04:18 +02:00
ln -s "$file" ~/."$file"
2014-11-03 17:40:13 +01:00
echo "$(tput setaf 64)$(tput sgr0) Created symlink to $(tput setaf 37)$file$(tput sgr0)"
2012-06-18 01:10:31 +02:00
done
2014-11-03 17:40:13 +01:00
# ----------------------------------------------------------------------
# source what we just created
# ----------------------------------------------------------------------
source ~/.bash_profile
# ----------------------------------------------------------------------
# Homebrew
# ----------------------------------------------------------------------
2017-06-12 01:21:12 +02:00
echo "$(tput setaf 136) Brewing all the things. "
echo "=============================================$(tput sgr0)"
"" # reset
2014-11-03 17:40:13 +01:00
2017-05-21 00:59:35 +02:00
bin/install-brew.sh
2014-11-03 17:40:13 +01:00
2017-06-12 01:21:12 +02:00
echo "$(tput setaf 64)---------------------------------------------"
echo " ✓ done$(tput sgr0)"
2014-11-03 17:40:13 +01:00
# ----------------------------------------------------------------------
# npm
# ----------------------------------------------------------------------
2017-06-12 01:21:12 +02:00
echo "$(tput setaf 136) npm all the things. "
echo "=============================================$(tput sgr0)"
2014-11-03 17:40:13 +01:00
2017-05-21 00:59:35 +02:00
bin/install-npm.sh
2014-11-03 17:40:13 +01:00
2017-06-12 01:21:12 +02:00
echo "$(tput setaf 64)---------------------------------------------"
echo " ✓ done$(tput sgr0)"
2014-11-03 17:40:13 +01:00
# ----------------------------------------------------------------------
# Ruby
# ----------------------------------------------------------------------
2017-06-12 01:21:12 +02:00
echo "$(tput setaf 136) Ruby all the things. "
echo "=============================================$(tput sgr0)"
2014-11-03 17:40:13 +01:00
2017-05-21 00:59:35 +02:00
bin/install-ruby.sh
2014-11-03 17:40:13 +01:00
2017-06-12 01:21:12 +02:00
echo "$(tput setaf 64)---------------------------------------------"
echo " ✓ done$(tput sgr0)"
2014-11-03 17:40:13 +01:00
2017-06-12 01:21:12 +02:00
echo "$(tput setaf 64)============================================="
2014-11-03 17:40:13 +01:00
echo " ✓ all done"
2017-06-12 01:21:12 +02:00
echo "=============================================$(tput sgr0)"