mirror of
https://git.proxmox.com/git/pve-eslint
synced 2025-10-04 10:28:39 +00:00
d/scripts/prepare-changes: make argument check more robust
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>
This commit is contained in:
parent
857347d600
commit
44f2865898
7
debian/scripts/prepare-changes.sh
vendored
7
debian/scripts/prepare-changes.sh
vendored
@ -2,7 +2,8 @@
|
||||
|
||||
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."
|
||||
@ -24,8 +25,8 @@ sed -i '/ ci: /Id' "$cfn"
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user