From 26f34a767b837e8d3db846138a3ef89144e3d6d8 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Sun, 9 Jan 2022 16:08:26 +0100 Subject: [PATCH] be more tolerant on PACKAGE_NAME argument when a package name is given to `create-xdc.sh`, this may be just a copy+pasted filename. that, however, results in double `.xdc` extensions. this pr accepts PACKAGE_NAME with or without .xdc extensions, of course, when creating the final ZIP, .xdc is always added, however only once :) moreover, this pr documents the weird string manipulation commands. --- create-xdc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create-xdc.sh b/create-xdc.sh index 5bfc778..66b4702 100755 --- a/create-xdc.sh +++ b/create-xdc.sh @@ -6,10 +6,10 @@ case "$1" in exit ;; "") - PACKAGE_NAME=${PWD##*/} + PACKAGE_NAME=${PWD##*/} # '##*/' removes everything before the last slash and the last slash ;; *) - PACKAGE_NAME=$1 + PACKAGE_NAME=${1%.xdc} # '%.xdc' removes the extension and allows PACKAGE_NAME to be given with or without extension ;; esac