From ba85d6737dd73814a0e7620563424a2b2ee8fc01 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Mon, 3 Jan 2022 16:38:34 -0500 Subject: [PATCH] create-xdc.sh improvements, use project name as default PACKAGE_NAME --- create-xdc.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/create-xdc.sh b/create-xdc.sh index c017b71..5bfc778 100755 --- a/create-xdc.sh +++ b/create-xdc.sh @@ -1,12 +1,17 @@ #!/bin/sh -if [ $# -eq 0 ] -then - echo "usage: zip-xdc.sh PACKAGE_NAME" - exit -fi - -PACKAGE_NAME=$1 +case "$1" in + "-h" | "--help") + echo "usage: ${0##*/} [PACKAGE_NAME]" + exit + ;; + "") + PACKAGE_NAME=${PWD##*/} + ;; + *) + PACKAGE_NAME=$1 + ;; +esac rm $PACKAGE_NAME.xdc 2> /dev/null zip -9 --recurse-paths $PACKAGE_NAME.xdc * --exclude README.md webxdc.js "*.sh" "*.xdc"