-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·58 lines (47 loc) · 1.39 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·58 lines (47 loc) · 1.39 KB
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
#!/bin/bash
############################
# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles
############################
BASE_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exe() { "$@" ; [ $? == 0 ] && ret="\x1B[47m OKAY" || ret="\x1B[41m FAIL"; echo -e "$ret \x1B[0m \$ $@" ; }
header() { printf "\n==========$@========================================\n\n"; }
link_file() {
if [ -h $HOME/$@ ] || [ -f $HOME/$@ ]; then
exe mv $HOME/$@ $BACKUP_FOLDER/$@
fi
exe ln -s $BASE_PATH/$@ $HOME/$@
}
# Make backup folder
BACKUP_FOLDER="$HOME/.dotfiles_backup"
if [ -d "$BACKUP_FOLDER" ]; then
echo -e "\x1B[41m FAIL \x1B[0m Directory $BACKUP_FOLDER exists already, back it up and remove, then run install script again."
exit 1
fi
mkdir $BACKUP_FOLDER
# bash_profile
header "bash profile"
link_file ".bash_profile"
# tmux
header "tmux config"
link_file ".tmux.conf"
# Link vimrc
header "vim"
link_file ".vimrc"
# Scm breeze
header "scm_breeze"
if [ -d $HOME/.scm_breeze ]; then
exe $HOME/.scm_breeze/uninstall.sh
exe mv $HOME/.scm_breeze $BACKUP_FOLDER
fi
if [ -h $HOME/.scm_breeze ]; then
echo "scm_breeze already installed, skipping."
else
exe ln -s $BASE_PATH/scm_breeze $HOME/.scm_breeze
$HOME/.scm_breeze/install.sh
fi
# Fonts
# fonts/install.sh
header "source profile"
exe source $HOME/.bash_profile
header "notes"
printf "\nRESTART SHELL\n"