1
0
Fork 0
mirror of synced 2024-05-29 13:31:11 -04:00
ultimate-vim/install_awesome_parameterized.sh
Quentin Meeus 04988ed839
fix typo when installing for specific users (#578)
line 34 had `~/$user` which evaluates to `/home/user1/user1`. Now changed into `~$user` as above
2020-07-10 23:26:23 -04:00

42 lines
1,014 B
Bash
Executable file

#!/bin/bash
set -e
echo 'Installing Awesome Vim from '$1
cd $1
VIMRC="set runtimepath+=$1
source $1/vimrcs/basic.vim
source $1/vimrcs/filetypes.vim
source $1/vimrcs/plugins_config.vim
source $1/vimrcs/extended.vim
try
source $1/my_configs.vim
catch
endtry"
if [ "$2" = "--all" ]; then
USERS=$(ls -l /home | awk '{if(NR>1)print $9}')
for user in $USERS; do
homepath=$(eval echo "~$user")
IFS=''
echo $VIMRC > ${homepath}/.vimrc
unset IFS
echo "Installed the Ultimate Vim configuration for user $user successfully! Enjoy :-)"
done
echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)"
exit 0
else
SELECTED_USERS=${@:2}
echo "Selected users: $SELECTED_USERS"
for user in $SELECTED_USERS; do
homepath=$(eval echo "~$user")
IFS=''
echo $VIMRC > ${homepath}/.vimrc
unset IFS
echo "Installed the Ultimate Vim configuration for user $user successfully! Enjoy :-)"
done
exit 0
fi