-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·53 lines (44 loc) · 1.23 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
####Variables
dir=~/dot-files #dot files directory
olddir=~/dot-files_old #old dot-files backup directory
envs=("Ubuntu" "WSL" "MSYS2 None")
#list of modules to stow
modules="bash readline vim tmux git X nvim ranger alacritty kitty urxvt"
####
#Create dot-files_old in homedir
echo "Creating $olddir for backup of any exsitings dotfiles in ~"
mkdir -p $olddir
echo "DONE"
#Change to dot-files
echo "Changing to the $dir directory"
cd $dir
echo "DONE"
#Initialize git submodules
echo "Initialising git submodules"
git submodule init && git submodule update
echo "DONE"
echo "Stowing dot files"
for module in $modules; do
# TODO: Loop through files in each module and backup
#echo "Backing up ~/.$file to $olddir/$file"
#mv ~/$file $olddir/
stow -v $module
done
echo "DONE"
# Prompt for specific environment and apply spcific configs
echo "Select specific environment you're on:"
select env in ${envs[@]}
do
case $env in
None) echo "no selected"
break ;;
*) echo "Copying .env/$env.bashrc to ~/.bash_env"
cp $HOME/dot-files/.env/$env.bashrc ~/.bash_env
break ;;
esac
done
echo "Applying bash config"
source ~/.bashrc
echo "Installing Vim Plugins"
vim +PlugInstall +qall