-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·107 lines (88 loc) · 2.67 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·107 lines (88 loc) · 2.67 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
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
if ! command -v git >/dev/null 2>&1; then
echo "git is required. Please install it first."
exit 1;
fi
cd ~
if [ ! -d "dotfiles" ] ; then
git clone git://github.com/sfabrizio/dotfiles.git dotfiles
fi
#detec OS
source ~/dotfiles/scripts/get_os_name.sh
OS_NAME=`get_os_name`
function isNodeJs {
if command -v node >/dev/null 2>&1; then
return 0;
else
return 1;
fi
}
if [[ "$OS_NAME" == 'windows' ]]; then
echo "windows detected running win bash install.."
sh ~/dotfiles/install-windows.sh
exit 0;
fi
#OSX install require packages
if [[ "$OS_NAME" == 'osx' ]]; then
if ! command -v brew >/dev/null 2>&1; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
if ! command -v byobu >/dev/null 2>&1; then
echo "installing byobu:"
brew install byobu
fi
if ! isNodeJs ; then
echo "installing node js:":
brew install node
fi
brew install neovim git-extras htop byobu
echo "osx-cpu-temp build";
cd ~/dotfiles/externals/osx-cpu-temp && make && cd ~
fi
# install package for any OS
npm_packages=('turbo-git' 'diff-so-fancy')
if ! isNodeJs ; then
echo "install node js adn them install the require packages by running:"
echo "'npm i -g ${npm_packages[@]}'"
else
npm install -g `${npm_packages[@]}`
fi
bash -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
if ! [ -d ~/.nvm ]; then
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash
fi
echo "Creating backup of your previus config files."
cp ~/.gitconfig ~/.gitconfig.bak > /dev/null
cp ~/.vimrc ~/.vimrc.bak > /dev/null
cp ~/.zshrc ~/.zshrc.bak > /dev/null
cp ~/.tmux.conf ~/.tmux.conf.bak > /dev/null
#creating folders
cd ~/
mkdir -p dotfiles
mkdir -p workspace
mkdir -p .tmux
mkdir -p .autoenv
mkdir -p .config/nvim
#creating symbolic links
ln -s env .env
echo "cloning git repos..."
cd ~
if [ ! -d "autoenv" ] ; then
git clone https://github.com/kennethreitz/autoenv.git .autoenv
fi
if [ ! -d ".tmux" ] ; then
cd ~/.tmux
git clone https://github.com/erikw/tmux-powerline.git
fi
cd ~/workspace
if [ ! -d "ozono-zsh-theme" ] ; then
git clone https://github.com/sfabrizio/ozono-zsh-theme
fi
echo "Coping new configuration files.."
echo "[include] path = ~/dotfiles/gitconfig" > ~/.gitconfig
echo "source ~/dotfiles/vimrc" > ~/.vimrc
echo "source ~/.vimrc" > ~/.config/nvim/init.vim
echo "source ~/dotfiles/zshrc" > ~/.zshrc
echo "source ~/dotfiles/tmux.conf" > ~/.tmux.conf
echo "source ~/dotfiles/tmux-powerlinerc" > ~/.tmux-powerlinerc
source ~/.zshrc
echo "Everything Done."