source rc files at the end of install
This commit is contained in:
parent
edd15f452a
commit
aefbc265f0
1 changed files with 26 additions and 8 deletions
26
install.sh
26
install.sh
|
|
@ -7,12 +7,18 @@ main() {
|
||||||
CALLING_DIR=$PWD
|
CALLING_DIR=$PWD
|
||||||
cd $DIR
|
cd $DIR
|
||||||
if [[ $1 == "--ycm" ]]; then
|
if [[ $1 == "--ycm" ]]; then
|
||||||
|
local vim_version=`vim --version | head -1 | cut -d " " -f 5`
|
||||||
|
if [[ $(echo "$vim_version >= 7.4" | bc) = 1 ]]; then
|
||||||
rm .youcompletemesetup
|
rm .youcompletemesetup
|
||||||
vim +BundleInstall +qall
|
vim +BundleInstall +qall
|
||||||
setup_youcompleteme
|
setup_youcompleteme
|
||||||
exit 0
|
else
|
||||||
|
echo "YCM requires vim 7.4 and up; you have ${vim_version}."
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
install_everything
|
install_everything
|
||||||
|
|
||||||
fi
|
fi
|
||||||
cd $CALLING_DIR
|
cd $CALLING_DIR
|
||||||
}
|
}
|
||||||
|
|
@ -44,6 +50,9 @@ install_everything() {
|
||||||
|
|
||||||
create_local_bin
|
create_local_bin
|
||||||
setup_local_symlinks
|
setup_local_symlinks
|
||||||
|
|
||||||
|
echo "sourcing rc files..."
|
||||||
|
source_rc_files
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_gitmodules() {
|
setup_gitmodules() {
|
||||||
|
|
@ -53,8 +62,8 @@ setup_gitmodules() {
|
||||||
}
|
}
|
||||||
|
|
||||||
symlink_files() {
|
symlink_files() {
|
||||||
source_dir=$1
|
local source_dir=$1
|
||||||
filenames=${@:2}
|
local filenames=${@:2}
|
||||||
|
|
||||||
for filename in $filenames
|
for filename in $filenames
|
||||||
do
|
do
|
||||||
|
|
@ -90,7 +99,7 @@ setup_local_symlinks() {
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_vim_symlink() {
|
setup_vim_symlink() {
|
||||||
vim_version=`vim --version | head -1 | cut -d " " -f 5`
|
local vim_version=`vim --version | head -1 | cut -d " " -f 5`
|
||||||
if [[ $(echo "$vim_version >= 7.4" | bc) = 1 ]]; then
|
if [[ $(echo "$vim_version >= 7.4" | bc) = 1 ]]; then
|
||||||
ln -s `which vim` ~/local/bin/vim
|
ln -s `which vim` ~/local/bin/vim
|
||||||
else
|
else
|
||||||
|
|
@ -103,4 +112,13 @@ setup_vim_symlink() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
source_rc_files() {
|
||||||
|
local current_shell=$(ps -p $$ | grep `echo $$` | awk '{print $4}')
|
||||||
|
if [[ "$current_shell" == "zsh" ]]; then
|
||||||
|
source ~/.zshrc
|
||||||
|
elif [[ "$current_shell" == "bash" ]]; then
|
||||||
|
source ~/.bashrc
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
main $@
|
main $@
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue