1515from src .Utilities .installer import make_action
1616from src .Utilities .installer import check_make_installation_status
1717
18- UPDATER_VER = "1.1.4 "
18+ UPDATER_VER = "1.2.0 "
1919GIT_DOWNLOAD_PAGE = "http://git-scm.com/"
2020VIM_DOWNLOAD_PAGE = "https://www.vim.org/download.php#pc"
2121VIM_REPO = "https://github.com/vim/vim.git"
@@ -29,8 +29,13 @@ def clean_install():
2929 Function to perform clean installation of vim: `git clone` and `make install`
3030 :return:
3131 """
32- print ("Starting git clone, it may not be quite fast" )
33- git_action ("clone" , VIM_REPO , USER_FOLDER + UPDATER_DIR )
32+ print ("Starting git clone, it may not be quite fast." )
33+ try :
34+ git_action ("clone" , VIM_REPO , USER_FOLDER + UPDATER_DIR )
35+ except Exception :
36+ print ("Fatal error: unable for access.\n Check internet connection." )
37+ sys_exit (1 )
38+
3439 print ("Current vim version in src:\n " + check_current_vim_version_in_src (USER_FOLDER + UPDATER_DIR ))
3540 make_action ("make" , USER_FOLDER + UPDATER_DIR )
3641 make_action ("install" , USER_FOLDER + UPDATER_DIR )
@@ -104,27 +109,30 @@ def main():
104109 git_status = git_version_output ))
105110
106111 if path .isdir (USER_FOLDER ) and path .exists (USER_FOLDER + UPDATER_DIR ):
107- print ("Work folder and updater dir here, check vim src folder" )
112+ print ("Work folder and updater dir here, checking vim src folder… " )
108113 if path .exists (USER_FOLDER + UPDATER_DIR ):
109- print ("VIM folder here" )
110114 if not path .exists (USER_FOLDER + UPDATER_DIR + "/.git" ):
111- print ("Can't find .git folder" )
112- print ("Removing work folder" )
115+ print ("Can't find .git folder. " )
116+ print ("Removing work folder… " )
113117 rmtree (USER_FOLDER + UPDATER_DIR )
114- print ("Work folder remover successfully, please run updater again" )
118+ print ("Work folder remover successfully, please run updater again. " )
115119 sys_exit (0 )
116120
117121 print ("Pulling from github..." )
118- is_updated = git_action ("pull" , USER_FOLDER + UPDATER_DIR )
122+ try :
123+ is_updated = git_action ("pull" , USER_FOLDER + UPDATER_DIR )
124+ except Exception :
125+ print ("Fatal error: unable for access.\n Check internet connection." )
126+ sys_exit (1 )
119127
120128 if is_updated :
121- print ("VIM already up to date\n " )
129+ print ("VIM already up to date. \n " )
122130 print (check_current_vim_version_in_system ())
123131 sys_exit (0 )
124132 print (check_current_vim_version_in_src (USER_FOLDER + UPDATER_DIR ))
125133 make_action ("make" , USER_FOLDER + UPDATER_DIR )
126134 make_action ("install" , USER_FOLDER + UPDATER_DIR )
127- print ("vim updated to {}" .format (check_current_vim_version_in_system ()))
135+ print ("vim updated to {}. " .format (check_current_vim_version_in_system ()))
128136
129137 else :
130138 clean_install ()
@@ -144,7 +152,7 @@ def main():
144152 clean_install ()
145153
146154 else :
147- print ("Error with user folder: {user_folder}" .format (user_folder = USER_FOLDER ))
155+ print ("Error with user folder: {user_folder}. " .format (user_folder = USER_FOLDER ))
148156 sys_exit (1 )
149157
150158
0 commit comments