From ee5d77d3e0cd9f1d12f166dc82361425e2d2e0b2 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Mon, 13 Aug 2007 18:56:44 +0000 Subject: [PATCH] Allow creation of project using only name and place it in pwd --- create.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/create.sh b/create.sh index 38ed309..85c3d5e 100755 --- a/create.sh +++ b/create.sh @@ -13,14 +13,23 @@ # Sanity checks -if [ $# -ne 2 ] -then +case "$#" in +1) + DEST_DIR="$(pwd)" + P="$1" + ;; +2) + DEST_DIR="$1" + P="$2" + ;; +**) 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 " @P@ package name" exit 1 -fi + ;; +esac cd "$(dirname $0)" TEMPLATE="$(pwd)/skel" @@ -30,15 +39,12 @@ DEVSCRIPTS="$(pwd)/scripts" # Get arguments, include standard functions source ${TEMPLATE}/scripts/functions.sh || exit 1 -DEST_DIR="$1"; shift -P="$1"; shift - DEST_DIR="${DEST_DIR}/${P}" # Ensure that we have our .lwbuildrc set up correctly. -LWBUILDRC=~/.lwbuildrc +LWBUILDRC="~/.lwbuildrc" if [ ! -e ${LWBUILDRC} ] then echo "You don't have a ${LWBUILDRC}, so I'll create a blank one for you."