update install.sh
This commit is contained in:
parent
c502afbca6
commit
5eb4e8a83f
@ -89,6 +89,42 @@ function backup_vimrc_file()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#备份原有的.vimrc.plugins文件
|
||||||
|
function backup_vimrc_plugins_file()
|
||||||
|
{
|
||||||
|
user=$1
|
||||||
|
home_path=$2
|
||||||
|
old_vimrc_plugins=$home_path".vimrc.plugins"
|
||||||
|
is_exist=$(is_exist_file $old_vimrc_plugins)
|
||||||
|
if [ $is_exist == 1 ]; then
|
||||||
|
time=$(get_datetime)
|
||||||
|
backup_vimrc_plugins=$old_vimrc_plugins"_bak_"$time
|
||||||
|
read -p "Find "$old_vimrc_plugins" already exists,backup "$old_vimrc_plugins" to "$backup_vimrc_plugins"? [Y/N] " ch
|
||||||
|
if [ $ch == "Y" ] || [ $ch == "y" ]; then
|
||||||
|
cp $old_vimrc_plugins $backup_vimrc_plugins
|
||||||
|
chown $user":"$user $backup_vimrc_plugins
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#备份原有的.vimrc.config文件
|
||||||
|
function backup_vimrc_config_file()
|
||||||
|
{
|
||||||
|
user=$1
|
||||||
|
home_path=$2
|
||||||
|
old_vimrc_config=$home_path".vimrc.config"
|
||||||
|
is_exist=$(is_exist_file $old_vimrc_config)
|
||||||
|
if [ $is_exist == 1 ]; then
|
||||||
|
time=$(get_datetime)
|
||||||
|
backup_vimrc_config=$old_vimrc_config"_bak_"$time
|
||||||
|
read -p "Find "$old_vimrc_config" already exists,backup "$old_vimrc_config" to "$backup_vimrc_config"? [Y/N] " ch
|
||||||
|
if [ $ch == "Y" ] || [ $ch == "y" ]; then
|
||||||
|
cp $old_vimrc_config $backup_vimrc_config
|
||||||
|
chown $user":"$user $backup_vimrc_config
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#备份原有的.vim目录
|
#备份原有的.vim目录
|
||||||
function backup_vim_dir()
|
function backup_vim_dir()
|
||||||
{
|
{
|
||||||
@ -111,6 +147,8 @@ function backup_vim_dir()
|
|||||||
function backup_vimrc_and_vim()
|
function backup_vimrc_and_vim()
|
||||||
{
|
{
|
||||||
backup_vimrc_file $1 $2
|
backup_vimrc_file $1 $2
|
||||||
|
backup_vimrc_plugins_file $1 $2
|
||||||
|
backup_vimrc_config_file $1 $2
|
||||||
backup_vim_dir $1 $2
|
backup_vim_dir $1 $2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user