Allow creation of project using only name and place it in pwd

This commit is contained in:
Laurence Withers 2007-08-13 18:56:44 +00:00
parent ccd9533217
commit ee5d77d3e0
1 changed files with 14 additions and 8 deletions

View File

@ -13,14 +13,23 @@
# Sanity checks # Sanity checks
if [ $# -ne 2 ] case "$#" in
then 1)
DEST_DIR="$(pwd)"
P="$1"
;;
2)
DEST_DIR="$1"
P="$2"
;;
**)
echo "Creates a new project using lw-build-system." echo "Creates a new project using lw-build-system."
echo "Usage: $0 path/to/projects @P@" echo "Usage: $0 [path/to/projects] @P@"
echo " path/to/projects directory in which project subdir will be created" echo " path/to/projects directory in which project subdir will be created"
echo " @P@ package name" echo " @P@ package name"
exit 1 exit 1
fi ;;
esac
cd "$(dirname $0)" cd "$(dirname $0)"
TEMPLATE="$(pwd)/skel" TEMPLATE="$(pwd)/skel"
@ -30,15 +39,12 @@ DEVSCRIPTS="$(pwd)/scripts"
# Get arguments, include standard functions # Get arguments, include standard functions
source ${TEMPLATE}/scripts/functions.sh || exit 1 source ${TEMPLATE}/scripts/functions.sh || exit 1
DEST_DIR="$1"; shift
P="$1"; shift
DEST_DIR="${DEST_DIR}/${P}" DEST_DIR="${DEST_DIR}/${P}"
# Ensure that we have our .lwbuildrc set up correctly. # Ensure that we have our .lwbuildrc set up correctly.
LWBUILDRC=~/.lwbuildrc LWBUILDRC="~/.lwbuildrc"
if [ ! -e ${LWBUILDRC} ] if [ ! -e ${LWBUILDRC} ]
then then
echo "You don't have a ${LWBUILDRC}, so I'll create a blank one for you." echo "You don't have a ${LWBUILDRC}, so I'll create a blank one for you."