Skip to content

Commit df468fc

Browse files
committed
auto exit when cmd run error
1 parent 9911a28 commit df468fc

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ compiler:
2424
- gcc
2525

2626
script:
27+
- cmake --version
2728
- ./install.sh
2829
- sudo vim +PluginClean +qall

install-plugins.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ function init {
2525
}
2626

2727
function rebuild() {
28+
set -e
29+
set -o pipefail
2830
cd ~/.vim/bundle/YouCompleteMe && git submodule update --init --recursive && sudo ./install.py "$@"
2931
}
3032

install.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env bash
2+
set -e
3+
set -o pipefail
24

35
function echoo {
46
echo -e "\n\033[32m $1 \033[0m"
@@ -9,22 +11,25 @@ function backup {
911

1012
now=`date +%Y%m%dT%H-%M-%S`
1113
for i in $HOME/.vim $HOME/.vimrc; do
12-
echo $i'-->'$i.$now
13-
[ -e $i ] && sudo mv $i $i.$now;
14+
echoo $i' --> '$i.$now
15+
[ -e $i ] && sudo mv $i $i.$now
1416
done
17+
18+
echoo ">>> backup finished"
1519
}
1620

1721
platform=""
1822
for i in "Centos","Centos" "Ubuntu","Ubuntu" "Darwin","MacOSX"; do
1923
key=${i%,*}; value=${i#*,};
2024
if [ `python -mplatform | grep -ic $key` == 1 ]; then
2125
platform=$value
22-
echoo "You os is $platform."
26+
echoo ">>> You os is $platform."
2327
fi
2428
done
2529

2630

2731
backup
32+
2833
case $platform in
2934
Centos)
3035
sudo bash scripts/init-vim-centos.sh
@@ -33,9 +38,11 @@ case $platform in
3338
sudo bash scripts/init-vim-ubuntu.sh
3439
;;
3540
MacOSX)
41+
echoo ">>> Install dependencies ..."
3642
bash scripts/init-vim-osx.sh
3743
echoo ">>> Install fonts for powerline ..."
3844
bash fonts/install-fonts.sh
45+
;;
3946
esac
4047

4148
sudo bash install-plugins.sh init

0 commit comments

Comments
 (0)