summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README8
-rwxr-xr-xmakeprj.sh78
2 files changed, 86 insertions, 0 deletions
diff --git a/README b/README
index e69de29..f9d975d 100644
--- a/README
+++ b/README
@@ -0,0 +1,8 @@
1Two scripts to help you create projects
2
31. usage : ./eflprj proj_path proj_name usr_name usr_email www (without http:// !!)
4
52. usage : ./makeprj.sh proj_name [www]
6Project name is mandatory.
7Picks up email and name from git config.
8www site address is optional. Defaults to www.enlightenment.org
diff --git a/makeprj.sh b/makeprj.sh
new file mode 100755
index 0000000..8fb8f25
--- /dev/null
+++ b/makeprj.sh
@@ -0,0 +1,78 @@
1#! /bin/bash
2
3if [ $# -lt 1 ]; then
4 echo "usage : $0 proj_name [www]"
5 echo "Project name is mandatory."
6 exit 1
7fi
8
9SELF=$(readlink -f $0)
10SRC=${SELF%/*}
11echo $SELF $SRC
12
13PROJ=$1
14NAME=`git config user.name`
15if [ "$?" -eq 1 ]
16then
17 echo "Setup git username first."
18 echo "git config --global user.name "Your Name""
19 exit 1
20fi
21
22EMAIL=`git config user.email`
23if [ "$?" -eq 1 ]
24then
25 echo "Setup git email first."
26 echo "git config --global user.email "you@example.com""
27 exit 1
28fi
29
30if [ -z "$NAME" ]
31then
32 NAME="Enlightenment"
33fi
34
35if [ -z "$EMAIL" ]
36then
37 NAME="enlightenment-devel@lists.sourceforge.net"
38fi
39
40if [ -z "$2" ]
41then
42 WWW="www.enlightenment.org"
43else
44 WWW=$2
45fi
46
47SELF=$(readlink -f $0)
48SRC=${SELF%/*}
49
50PROJ_U=$(echo "$PROJ" | sed 's/.*/\u&/')
51PROJ_UU=$(echo "$PROJ" | sed 's/.*/\U&/')
52PROJ_LL=$(echo "$PROJ" | sed 's/.*/\L&/')
53rm -fr .git || exit 1
54git init && git add . &> /dev/null && git commit -sa -m "Initial commit." &> /dev/null || exit 1
55
56echo "" > description
57for file in $(git ls-files); do
58 [ "$file" = "makeprj.sh" ] && continue
59 [ "$file" = "eflprj" ] && continue
60 echo "$file" | grep -qE '^m4' && continue
61 sed -i "s/skeleton/${PROJ_LL}/g;s/Skeleton/${PROJ_U}/g;s/SKELETON/${PROJ_UU}/g;s/www.enlightenment.org/${WWW}/g;" $file
62 sed -i "s/Cedric\ Bail/${NAME}/g;s/cedric\.bail@samsung\.com/${EMAIL}/g;s/Cedric\ BAIL/${NAME}/g;" $file
63done
64for file in $(find -name '*skeleton*'); do
65 name=$(echo "$file" | sed "s/skeleton/${PROJ_LL}/")
66 mv $file $name
67done
68for file in $(find -name '*Skeleton*'); do
69 name=$(echo "$file" | sed "s/Skeleton/${PROJ_U}/")
70 mv $file $name
71done
72echo $NAME "<$EMAIL>" >> AUTHORS
73grep --color=auto -R FIXME .
74
75mv $PWD ${PWD%/*}/$PROJ
76echo "Execute : cd ${PWD%/*}/$PROJ"
77exit 0
78