set -u aborts if we access any undefined variable, which $1 can be if
no argument got passed..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
set -eu -o pipefail
-if [[ $1 =~ ^-(h|-help)$ ]]; then
+arg="${1:-}"
+if [[ $arg =~ ^-(h|-help)$ ]]; then
echo "usage: $0 [<FROM-VERSION>]"
echo ""
echo "Filter out irrelevant entries (sponsors, chore, docs) from the upstream changelog."
sed -i '/ build: /Id' "$cfn"
sed -i '/ESLint Jenkins/Id' "$cfn"
-if [[ $1 ]]; then
- version="$1"
+if [[ $arg ]]; then
+ version="$arg"
sed -i "/^$version -/Q" "$cfn"
sed -i '/^\+ /!d' "$cfn"
fi