-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·66 lines (59 loc) · 1.53 KB
/
install
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
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
echo -e "======= DEPLOYING SLOBY CONFIG FILES ======="
read -p "Do you want to apply the configuration?" -n 1 -r
if [ "$REPLY" == 'y' ]; then
echo -e "\nBacking up existing stuff ..."
if [ ! -d ~/cfgtemp ]; then
mkdir -v ~/cfgtemp
else
echo -e "\n~/cfgtemp already exists"
fi
if [ -d ~/cfgtemp ]; then
if [ -d ~/.vim ]; then
#if .vim directory exists, move it to a backup folder
mv -vf ~/.vim ~/cfgtemp/vimbak
fi
cp -v .vimrc ~/cfgtemp/vimrcbak
cp -v .gitconfig ~/cfgtemp/gitconfigbak
cp -v .bashrc ~/cfgtemp/bashrcbak
echo -e "\nBackup finished"
else
echo -e "\nBackup failed! Exiting"
exit
fi
echo -e "\nCopying .vim folder ..."
cp -r vim ~/.vim
if [ "$?" -ne 0 ]; then
#if copy was successful
mv ~/.vimbak ~/.vim
else
#if copy failed
rm -rf ~/.vimbak
fi
echo -e " Done"
echo -e "\nCopying .vimrc ..."
cp .vimrc ~/.vimrc
echo -e " Done"
echo -e "\nCopying .gitconfig ..."
cp .gitconfig ~/.gitconfig
echo -e " Done"
echo -e "\nCopying .bashrc ..."
cp .bashrc ~/.bashrc
echo -e " Done"
echo -e "\nCreating localized script folder ..."
if [ ! -d ~/.local ]; then
mkdir ~/.local
fi
if [ ! -d ~/.local/bin ]; then
mkdir ~/.local/bin
fi
echo " Done"
echo -e "\nCopying custom scripts to local script folder ..."
cp custom_scripts/startdjangoproject ~/.local/bin
cp custom_scripts/startmavenproject ~/.local/bin
cp custom_scripts/list_installed_packages ~/.local/bin
cp custom_scripts/docker_cleanup_volumes.sh ~/.local/bin
echo " Done"
else
echo -e "\n======= Exiting! ======="
fi