Fix test for directory
[git-tools-moved-to-github.git] / id-new-project / id-new-project.sh
index f2690b2..3fa1bcc 100755 (executable)
@@ -1,8 +1,9 @@
 #!/bin/sh
 
 usage() {
+        echo ""
        echo "Usage:"
-       echo "id-new-project.sh srcdir description {pub/private}"
+       echo "id-new-project.sh srcdir description {pub/private/admin}"
        echo "For example:"
        echo "id-new-project.sh ../myproj \"Which does good things\" private"
        exit 1
@@ -12,9 +13,10 @@ SRC=$1
 DESC=$2
 TYPE=$3
 
-if test -z "${TYPE}"; then
-       usage 
-fi
+case "${TYPE}" in
+       pub | private | admin ) ;;
+       * ) echo "invalid type: '$TYPE', use pub or private or admin "; usage ;;
+esac
 
 if test ! -e post-receive; then
        echo "file post-receive must be in the current directory"