-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.sh
executable file
·79 lines (70 loc) · 2.23 KB
/
make.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
############################
# .make.sh:w
# This script creates symlinks from the home directory to any desired dotfiles in ~/.dotfiles
############################
# Install Homebrew https://brew.sh
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
brew update
fi
############################################
# Homebrew
#############################################
# Install neo vim via Homebrew
if brew ls --versions neovim > /dev/null; then
echo "neovim already installed"
else
brew install neovim
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
# Install emacs via Homebrew
if brew ls --versions emacs > /dev/null; then
echo "emacs already installed"
else
brew install emacs --with-cocoa
fi
# Install aspell
if brew ls --version aspell > /dev/null; then
echo "aspell already installed"
else
brew install aspell
fi
##########################################
# git clones
#########################################
if [ ! -d ~/Documents/github/git ];
then
echo "Clone git repo"
cd ~/Documents/github
git clone [email protected]:git/git.git
cd ~/Documents/github/dotfiles
fi
if [ ! -e ~/Documents/github/djinni-mode.el ];
then
echo "Clone threeve repo"
cd ~/Documents/github
git clone https://github.com/threeve/djinni-mode.el.git
cd ~/Documents/github/dotfiles
fi
###############################################
# Dotfiles
##############################################
# variables
olddir=~/dotfiles_old # old dotfiles backup directory
files="bashrc bash_profile vimrc vim gitconfig config emacs.d" # list of files/folders to symlink in homedir
# create dotfiles_old in homedir
echo "Creating $olddir for backup of any existing dotfiles in ~"
mkdir -p $olddir
echo "...done"
# move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks
echo "Moving any existing dotfiles from ~ to $olddir"
for file in $files; do
mv ~/.$file ~/dotfiles_old/
echo "Creating symlink to $file in home directory."
ln -s "$(pwd)"/.$file ~/.$file
done