-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbug-create-project.in
37 lines (25 loc) · 1.03 KB
/
bug-create-project.in
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
#!/usr/bin/env sh
PROJECTNAME=${1:-"myproj"}
VERSION=${2:-"0.0.1"}
AUTHOR=${3:-"John Doe <[email protected]>"}
display_usage() {
echo "bug-create-project requires 3 arguments."
echo "\nUsage:\nbug-create-project project-name initial-version-number author \n"
echo "Example:\nbug-create-project $PROJECTNAME $VERSION \"$AUTHOR\""
}
# if less than three arguments supplied, display usage
if [ $# -le 2 ]
then
display_usage
exit 1
fi
cp -r @prefix@/share/@PACKAGE_NAME@/demo/ $PROJECTNAME
cd $PROJECTNAME
find . -type f -iname '*' | xargs sed -i -e "s/bugdemo/$PROJECTNAME/g"
find . -type f -iname '*' | xargs sed -i -e "s/0.0.1/$VERSION/g"
find . -type f -iname '*' | xargs sed -i -e "s/William Emerison Six <[email protected]>/$AUTHOR/g"
mv src/bugdemo.scm src/$PROJECTNAME.scm
sed -i -e '/^;;/ d' src/$PROJECTNAME.scm
#for some strange reason on OS X, this script works correctly, but sed seems to be creating new files
# which a '-e' suffixed. I'm lazy for now, just remove them
for x in $(find . -type f -iname '*-e') ; do rm $x ; done