summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjeev BA <iamsanjeev@gmail.com>2017-04-27 10:35:35 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-04-27 10:35:40 -0700
commitf44916e6d04224eb711cb7fed81f0bc0f464696e (patch)
tree580d606e5200858eba93a39c941c1f4cac3a3f9f
parent24f27aa356566b55ffd69ff8592ed3070a50b14e (diff)
update readme and add new script.HEADmaster
Summary: Signed-off-by: Sanjeev BA <iamsanjeev@gmail.com> Test Plan: eflprg script does a good job but after creating it - there is much pain. It creates a folder and clones skeleton into it, find and replaces incorrectly and finally user need to either move the directory or know where to create it before hand. makeprg.sh does away with most of it. It replaces cedric string in the same folder. and renames the same folder to the project name. Picks up git user and email from gitconfig and uses it. Also adds user to authors file. Reviewers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4829 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-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