File install sh bin bash source utils install_tools sh create_settings

 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
# File: install.sh
#!/bin/bash
source utils/install_tools.sh
create_settings
create_links /web/django-bricks . utils
create_dirs pub/css pub/js
create_links /web/libcss pub/css base.css form.css base-color-scheme.css
#create_links /web/libjs pub/js jquery xinha tools.js ajaxforms.js
/usr/bin/env python manage.py validate
# File: utils/install_tools.sh
#!/bin/bash
make_links() {
src_dir=$1
dst_dir=$2
shift 2
link_list=$*
pushd .
cd $dst_dir
for link in $link_list; do
file=$src_dir/$link
if [ ! -e $link ]; then
echo "$src_dir/$link --> $dst_dir/$link"
ln -s $src_dir/$link
fi
done
popd
}
make_dirs() {
dirs=$*
for dir in dirs; do
if [ ! -e $dir ]; then
mkdir $dir
fi
done
}
make_pub_dirs() {
dirs=$*
for dir in dirs; do
if [ ! -e $dir ]; then
mkdir $dir
fi
chmod a+rwx $dir
done
}
make_settings() {
if [ ! -f settings_local.py ]; then
echo "creating settings_local.py"
echo DOMAIN = \'\' > settings_local.py
fi
}