diff options
Diffstat (limited to 'ncomp-maven-sirius-runtime/src/main/resources/new_project.sh')
-rw-r--r-- | ncomp-maven-sirius-runtime/src/main/resources/new_project.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ncomp-maven-sirius-runtime/src/main/resources/new_project.sh b/ncomp-maven-sirius-runtime/src/main/resources/new_project.sh new file mode 100644 index 0000000..61e18ff --- /dev/null +++ b/ncomp-maven-sirius-runtime/src/main/resources/new_project.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +DIR=$1 +GGGG=$2 +AAAA=$3 +PORT=$4 + +BBBB=`echo $AAAA | sed s/$NCOMPNAME-//g` +CCCC=`echo $AAAA | sed 's/.*-//g'` + +SDIR=git/$GGGG/$AAAA/src/main/server/config + +## for V in RDIR AAAA PORT BBBB CCCC SDIR; do echo $V=$(eval echo \$$V); done + +if [ -e $DIR ]; then echo Directory exists: $DIR; exit; fi +mkdir -p $DIR + +if [ -e $SDIR ]; then + cp -rp $SDIR $DIR/config +fi + +if [ -e $DIR/config/pw.sh.sh ]; then + bash $DIR/config/pw.sh.sh > $DIR/config/pw.sh + chmod +x $DIR/config/pw.sh + rm $DIR/config/pw.sh.sh +fi + +if [ -e $DIR/config ]; then + for V in AAAA PORT BBBB + do + find $DIR/config -type f | xargs -I X sed -i s/$V/$(eval echo \$$V)/g X + done +fi + +if [ -e $DIR/config/pw.sh ]; then + find $DIR/config -type f \! -name pw.sh | xargs -I X echo "cat X | $DIR/config/pw.sh > X.bak; mv X.bak X" | bash +fi + +if [ -e $DIR/config/makefile ]; then + mv $DIR/config/makefile $DIR/makefile +fi + + + |