-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·68 lines (44 loc) · 1.04 KB
/
deploy.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
#! /usr/bin/env bash
# Reset
Color_Off='\033[0m' # Text Reset
# Regular Colors
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
function log() {
printf ">> ${1}\n"
}
function log_info() {
log "${Green}${1}${Color_Off}"
}
function log_error() {
log "${Red}${1}${Color_Off}"
}
function die() {
log_error "Something went wrong"
exit 1
}
function symlink() {
FROM="${1}"
TO="${2}"
log_info "Trying to link ${FROM} to ${TO}"
ln -s "${FROM}" "${TO}"
}
################################################################################
# Get environment paths
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
PROJECTDIR=$(pwd)
function deploy_vim () {
symlink "${PROJECTDIR}"/.vimrc ~/.vimrc
symlink "${PROJECTDIR}"/.vim ~/.vim
}
function deploy_bash() {
symlink "${PROJECTDIR}"/.bash_aliases ~/.bash_aliases
}
function deploy_rc() {
symlink "${PROJECTDIR}"/.ackrc ~/.ackrc
symlink "${PROJECTDIR}"/.tmux.conf ~/.tmux.conf
}
deploy_vim
deploy_bash
deploy_rc