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
|
||||
cd $DIR
|
||||
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
|
||||
vim +BundleInstall +qall
|
||||
setup_youcompleteme
|
||||
exit 0
|
||||
else
|
||||
echo "YCM requires vim 7.4 and up; you have ${vim_version}."
|
||||
fi
|
||||
|
||||
else
|
||||
install_everything
|
||||
|
||||
fi
|
||||
cd $CALLING_DIR
|
||||
}
|
||||
|
|
@ -44,6 +50,9 @@ install_everything() {
|
|||
|
||||
create_local_bin
|
||||
setup_local_symlinks
|
||||
|
||||
echo "sourcing rc files..."
|
||||
source_rc_files
|
||||
}
|
||||
|
||||
setup_gitmodules() {
|
||||
|
|
@ -53,8 +62,8 @@ setup_gitmodules() {
|
|||
}
|
||||
|
||||
symlink_files() {
|
||||
source_dir=$1
|
||||
filenames=${@:2}
|
||||
local source_dir=$1
|
||||
local filenames=${@:2}
|
||||
|
||||
for filename in $filenames
|
||||
do
|
||||
|
|
@ -90,7 +99,7 @@ setup_local_symlinks() {
|
|||
}
|
||||
|
||||
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
|
||||
ln -s `which vim` ~/local/bin/vim
|
||||
else
|
||||
|
|
@ -103,4 +112,13 @@ setup_vim_symlink() {
|
|||
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 $@
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue