-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·57 lines (49 loc) · 1.12 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
54
55
56
57
#!/bin/bash
CONF_SUB_DIR="bashrc/karlzheng_config"
CONF_DIR="${HOME}/${CONF_SUB_DIR}"
function cp_shell_script()
{
mkdir -p "$CONF_DIR"
local filelist=(
adb.bash_complete.sh
mypathfunctions.sh
my_ssh_bashrc.sh
install.sh
)
for i in ${filelist[@]}; do
if [ ! -f "$CONF_DIR/$i" -a -f "./$i" ];then
echo cp "./$i" "$CONF_DIR/"
cp "./$i" "$CONF_DIR"
else
echo "exist $CONF_DIR/$i"
fi
done
}
function add_dot_bashrc_call()
{
local f="${HOME}/.bashrc"
if [ -e ${f} ];then
grep "$CONF_SUB_DIR" "${HOME}/.bashrc" | grep "mybashrc"
if [ $? != 0 ];then
cat karlzheng_config/bashrc_prefix.txt >> ${HOME}/.bashrc
#cp_shell_script
fi
else
echo "There is no file ${f}"
echo "cat karlzheng_config/bashrc_prefix.txt >> ${HOME}/.bashrc"
cat karlzheng_config/bashrc_prefix.txt >> ${HOME}/.bashrc
fi
}
function add_vim_config()
{
if [ ! -f ${HOME}/.vimrc -a -f .vimrc ];then
cp .vimrc ${HOME}/.vimrc
fi
if [ ! -d ${HOME}/.vim -a -d .vim ];then
cp .vim ${HOME}/.vim -a
fi
}
add_dot_bashrc_call
#sudo apt-get update
#sudo apt-get install vim-gnome
#add_vim_config