-
Notifications
You must be signed in to change notification settings - Fork 11
/
configure
executable file
·60 lines (56 loc) · 1.28 KB
/
configure
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
#!/bin/bash
###############################################################
# NAME
# configure -- configure local machine with .rc files
# or collect all local configure files to .rc
#
# USAGE
# ./configure -- configure local machine
# ./configure -c -- collect local configure files
#
# NOTE
# check $PATH include
# /usr/local/sbin
# /usr/local/bin
# /usr/sbin
# /usr/bin
# /sbin
# /bin
#
# AUTHOR
# Aborn Jiang (aborn.jiang@gmail.com)
#
# VERSION
# v0.1 2014-03-04
###############################################################
ABSPATH=$(dirname $0)
cd ${ABSPATH}
echo "ABSPATH=${ABSPATH}"
function conf-local()
{
cp ${ABSPATH}/.rc/.zshrc ~
cp ${ABSPATH}/.rc/.bashrc ~
cp ${ABSPATH}/.rc/.bash_aliases ~
cp ${ABSPATH}/.rc/.vimrc ~
}
function collect()
{
cp ~/.zshrc ${ABSPATH}/.rc/
cp ~/.bashrc ${ABSPATH}/.rc/
cp ~/.bash_aliases ${ABSPATH}/.rc/
cp ~/.vimrc ${ABSPATH}/.rc/
}
function __main__()
{
if [ "$1X" == "-cX" ];then
echo "-c argument, collect configure files."
collect
elif [ "$1X" == "X" ];then
conf-local
echo "configure local with .rc succuess."
else
echo "error argument."
exit -1
fi
}
__main__ $1