-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup_backup.sh
155 lines (124 loc) · 3.76 KB
/
setup_backup.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/bin/bash
# setting
kbk_dir=Develop/kubocker/dotfiles
# start
echo "Start setting of dotfiles..."
dotfiles=(
.bashrc
.bash_profile
.gitconfig
.tmux.conf
.vimrc
.fabricrc
)
dir=$(pwd)
if [ $dir != $HOME/$kbk_dir ]; then
echo "WARNING..."
echo "change path $kbk_dir"
return
fi
# mac
if [ $(uname -s) = 'Darwin' ]; then
# Homebrew
[ -z "$(which brew)" ] &&
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null
brew update
echo "Brewfile....."
brew tap Homebrew/bundle
brew tap caskroom/cask
brew tap pivotal/tap
brew tap ethereum/ethereum
brew bundle
# Downloads 管理 (local)
mkdir $HOME/Downloads/dmgs
mkdir $HOME/Downloads/documents
mkdir $HOME/Downloads/imgs
# Linux
else
# CentOS
echo "This is $(uname -s)"
echo "installing apps..."
sudo yum install -y git \
vim --with-python3 --without-python --with-lua \
patch httpd epel-release.noarch the_silver_searcher \
tig lsof jq tmux peco \
wget \
gcc zlib-devel bzip2 bzip2-devel readline readline-devel sqlite sqlite-devel openssl openssl-devel ctags \
lua-devel ncurses-devel \
ansible \
heroku
fi
echo 'Installing... controlling language versions'
# pyenv
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
# jenv
git clone https://github.com/gcuisinier/jenv.git ~/.jenv
## jenv add $(/usr/libexec/java_home -v 1.8)
# nodenv
git clone git://github.com/nodenv/nodenv.git ~/.nodenv
git clone https://github.com/nodenv/node-build.git ~/.nodenv/plugins/node-build
# SDKMAN
curl -s https://get.sdkman.io | bash
source "/Users/kubocker/.sdkman/bin/sdkman-init.sh"
sdk selfupdate force
sdk install kotlin
sdk install maven
sdk install springboot
sdk install sbt
sdk install scala
sdk install spark
sdk install leiningen
# nim
git clone https://github.com/nim-lang/nimble.git ~/.nimble
cd ~/.nimble
nim c src/nimble
src/nimble install
# stack -> haskell
curl -sSL https://get.haskellstack.org/ | sh
# rbenv
#git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
#git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
# phpenv
## curl -L https://raw.github.com/CHH/phpenv/master/bin/phpenv-install.sh | bash
## git clone git://github.com/CHH/php-build.git ~/.phpenv/plugins/php-build
# swiftenv
## git clone https://github.com/kylef/swiftenv.git ~/.swiftenv
# goenv
## git clone https://github.com/wfarr/goenv.git ~/.goenv
echo 'git prompt'
# git-prompt
if [ ! -e ~/.git-prompt.sh ]; then
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh
fi
echo 'git completion'
# git-completion
if [! -e ~/.git-completion.bash ]; then
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash > git-completion.bash
fi
echo 'Checking...'
if [ -e $HOME/.vim ]; then
echo 'rm -rf ~/.vim; then mkdir ~/.vim'
rm -rf $HOME/.vim
fi
echo "Installing vim-plug"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "make... symbolink"
for file in ${dotfiles[@]}
do
if [ -e $HOME/$file ]; then
rm -f $HOME/$file
fi
# ln -s $dir/dotfiles/$file $HOME/$file
ln -s $dir/dotfiles/dotfiles/$file $HOME/$file
done
# vim-plug
echo "Installing Vim Plugin"
vim +PlugInstall +qall
# source
echo "source ~/.bash_profile and ~/.bashrc"
source ~/.bash_profile
source ~/.bashrc
#exec $SHELL -l # 再読み込み
echo "setting tmux"
tmux source-file ~/.tmux.conf
echo "End setting of dotfiles"