Skip to content

Commit

Permalink
Skip renaming of files when the name of sub equals sub. Fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Habermann committed Sep 28, 2012
1 parent 6245664 commit e9570ff
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ fi
SUBNAME=$(echo $NAME | tr '[A-Z]' '[a-z]')
ENVNAME="$(echo $NAME | tr '[a-z]' '[A-Z]')_ROOT"

echo "Preparing your $SUBNAME sub!"
echo "Preparing your '$SUBNAME' sub!"

rm bin/sub
mv share/sub share/$SUBNAME
if [ "$NAME" != "sub" ]; then
rm bin/sub
mv share/sub share/$SUBNAME

for file in **/sub*; do
sed "s/sub/$SUBNAME/g" $file | sed "s/SUB_ROOT/$ENVNAME/g" > $(echo $file | sed "s/sub/$SUBNAME/")
rm $file
done
for file in **/sub*; do
sed "s/sub/$SUBNAME/g" $file | sed "s/SUB_ROOT/$ENVNAME/g" > $(echo $file | sed "s/sub/$SUBNAME/")
rm $file
done

for file in libexec/*; do
chmod a+x $file
done
for file in libexec/*; do
chmod a+x $file
done

ln -s ../libexec/$SUBNAME bin/$SUBNAME
ln -s ../libexec/$SUBNAME bin/$SUBNAME
fi

rm LICENSE
rm README.md
Expand Down

0 comments on commit e9570ff

Please sign in to comment.