run shellcheck on helper scripts

fmt-my-stuff: #3595
squash-my-commits: __future__

fix shellcheck warnings on fmt-my-stuff and squash-my-commits
This commit is contained in:
lare 2024-03-19 10:03:16 +01:00
parent 1f76bc5adb
commit 87b641814f
No known key found for this signature in database
GPG key ID: 30C10A93B8B8E9FE
5 changed files with 17 additions and 18 deletions

View file

@ -68,8 +68,7 @@ done
##########################################################################
# check for dn42registry remote, and add if missing
git remote -v | grep dn42registry > /dev/null 2>&1
if [ "$?" -ne 0 ]
if ! git remote -v | grep dn42registry > /dev/null 2>&1
then
# was the URL specified directly ?
@ -81,8 +80,7 @@ then
if [ -z "$reg_proto" ]
then
# if the proto wasn't forced, try to guess it
git remote -v | grep 'https' > /dev/null 2>&1
if [ $? -eq 0 ]
if git remote -v | grep 'https' > /dev/null 2>&1
then
reg_proto='https'
else
@ -112,8 +110,7 @@ fi
# ensure the local branch is up to date
echo "Fetching dn42registry master"
git fetch dn42registry master
if [ $? -ne 0 ]
if ! git fetch dn42registry master
then
echo 'ERROR: Failed to fetch registry master branch'
echo 'Hint: you can use --ssh/--https to force use of ssh or https'
@ -123,8 +120,7 @@ then
fi
# find number of local commits
count=$(git rev-list --count HEAD ^dn42registry/master)
if [ $? -ne 0 ]
if ! count=$(git rev-list --count HEAD ^dn42registry/master)
then
echo "ERROR: Failed to find the number of local commits"
echo "Please report this as a bug to the registry maintainters"
@ -160,7 +156,7 @@ $(git log --oneline HEAD ^dn42registry/master)"
# and finally squash
git reset --soft dn42registry/master
git commit $do_sign -m "$comment"
git commit "$do_sign" -m "$comment"
# show what happened
echo '---'