-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_settings.sh
More file actions
executable file
·51 lines (45 loc) · 903 Bytes
/
init_settings.sh
File metadata and controls
executable file
·51 lines (45 loc) · 903 Bytes
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
#!/bin/bash
if [ -z "$1" ];then
echo "Modules : "
for m in $(ls -1 | grep -v init | grep -v README);do
echo " $m"
done
echo ""
echo "mvala's default :"
echo " ./init_settings.sh common bash mc git astyle root"
exit 0
fi
echo "Doing init ..."
MY_DO_CLEAR="0"
MY_DO_APPLY="1"
MY_SYNCS=""
if [ "$1" = "all" ];then
MY_SYNCS="common mc bash vim"
MY_SYNCS="$MY_SYNCS git root"
else
MY_SYNCS="$*"
fi
# clearing ...
for MY_SYNC in $MY_SYNCS;do
if [ -d "$MY_SYNC" ];then
MY_PWD=`pwd`
cd $MY_SYNC
if [ $MY_DO_CLEAR = "1" -a -f clear.sh ];then
echo " Clearing $MY_SYNC ..."
./clear.sh
fi
cd $MY_PWD
fi
done
# appling
for MY_SYNC in $MY_SYNCS;do
if [ -d "$MY_SYNC" ];then
MY_PWD=`pwd`
cd $MY_SYNC
if [ $MY_DO_APPLY = "1" -a -f apply.sh ];then
echo " Applying $MY_SYNC ..."
./apply.sh
fi
cd $MY_PWD
fi
done