Created
December 4, 2012 22:41
-
-
Save jmather/4209716 to your computer and use it in GitHub Desktop.
Easily create a new project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source /etc/profile | |
git init | |
mv base.iml $1.iml | |
cd .idea/ | |
cat modules.xml | sed "s/base/$1/g" > modules.xml.new | |
mv modules.xml.new modules.xml | |
cat workspace.xml | sed "s/base/$1/g" > workspace.xml.new | |
mv workspace.xml.new workspace.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source /etc/profile | |
PATH=$1 | |
SKELETON=~/var/project-skeleton | |
ROOT=~/Projects | |
NAME=${PATH##*/} | |
DIR=${PATH%%/*} | |
if [ "$DIR/$NAME" != "$1" ] | |
then | |
echo "Please enter your project in a directory/name format. Entered: $1" | |
exit | |
fi | |
if [ -d "$ROOT/$DIR/$NAME" ] || [ -f "$ROOT/$DIR/$NAME" ] | |
then | |
echo "The project '$1' already exists." | |
exit | |
fi | |
if [ ! -f $ROOT/$DIR ] && [ ! -d $ROOT/$DIR ] | |
then | |
echo mkdir $ROOT/$DIR | |
fi | |
cp -a $SKELETON $ROOT/$DIR/$NAME | |
cd $ROOT/$DIR/$NAME | |
if [ -f bin/.init.sh ] | |
then | |
sh bin/.init.sh $NAME | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment