From 0d2cd5e3c927e474ad060e8526929e331f1180e3 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Tue, 16 Apr 2013 16:06:54 -0700 Subject: [PATCH] Capture Segfault on Vim --- vim-sync-append.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/vim-sync-append.sh b/vim-sync-append.sh index 1a8ec82..ff92a88 100755 --- a/vim-sync-append.sh +++ b/vim-sync-append.sh @@ -90,7 +90,15 @@ command -v ruby >/dev/null 2>&1 || { echo "Warning: ruby required for Command T" command -v gcc >/dev/null 2>&1 || { echo "Warning: gcc required for Command T"; } # Execute vim's update of the helptags -vim +"helptags ~/.vim/doc" +"q" +VIM_RESULT=$(vim +"helptags ~/.vim/doc" +"q") + +if [[ "$VIM_RESULT" == *SEGV* ]]; then + echo "Seg Faulted. Retry with different ruby" + cd ~/.vim/bundle/Command-T/ruby/command-t && /opt/local/bin/ruby* extconf.rb && make && cd - + + # Retry + vim +"helptags ~/.vim/doc" +"q" +fi # Warn if ctags does not exist command -v ctags >/dev/null 2>&1 || { echo "Warning: ctags required for Tag List @@ -98,9 +106,7 @@ command -v ctags >/dev/null 2>&1 || { echo "Warning: ctags required for Tag List --- OSX (MacPorts): port install ctags"; } echo "Note: If VIM Segfaults try the following:" -echo " cd ~/.vim/bundle/Command-T/ruby/command-t" -echo " /opt/local/bin/ruby extconf.rb" -echo " make" +echo " cd ~/.vim/bundle/Command-T/ruby/command-t && /opt/local/bin/ruby* extconf.rb && make && cd -" echo "" echo "All done!"