~mgedmin/ubuntu.lt/socialauth

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

if [ $# != 1 ] ; then
    echo "Usage: startapp.sh application-name"
elif [ -e apps/$1 ] ; then
    echo "App '$1' already exists."
else
    modulename=$(echo $1 | sed 's/-/_/g')
    bin/django startapp $modulename && \
    cp --preserve=mode -r apps/.skeleton apps/$1 && \
    mv project/$modulename apps/$1/$modulename && \
    sed -i \
        -e 's/$(name)/'$1'/g' \
        -e 's/$(author)/'$USER'/g' \
        -e 's/$(date)/'$(date +%Y-%m-%d)'/g' \
            apps/$1/CHANGES.txt \
            apps/$1/docs/conf.py \
            apps/$1/docs/index.rst \
            apps/$1/setup.py 
fi