GHA: add shellcheck job and fix warnings, shell tidy-ups

Reviewed-by: Daniel Stenberg
Closes #13307
This commit is contained in:
Viktor Szakats 2024-04-07 10:02:49 +00:00
parent 2c4f836f70
commit fa69b41c77
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
12 changed files with 441 additions and 415 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
@ -23,28 +23,30 @@
#
###########################################################################
PREFIX=$1
set -eu
PREFIX="${1:-}"
# Run this script in the root of the git clone. Point out the install prefix
# where 'make install' has already installed curl.
if test -z "$1"; then
echo "scripts/installcheck.sh [PREFIX]"
exit
if test -z "$PREFIX"; then
echo "scripts/installcheck.sh [PREFIX]"
exit
fi
diff -u <(find docs/libcurl/ -name "*.3" -printf "%f\n" | grep -v template| sort) <(find $PREFIX/share/man/ -name "*.3" -printf "%f\n" | sort)
diff -u <(find docs/libcurl/ -name "*.3" -printf "%f\n" | grep -v template | sort) <(find "$PREFIX/share/man/" -name "*.3" -printf "%f\n" | sort)
if test "$?" -ne "0"; then
echo "ERROR: installed libcurl docs mismatch"
exit 2
echo "ERROR: installed libcurl docs mismatch"
exit 2
fi
diff -u <(find include/ -name "*.h" -printf "%f\n" | sort) <(find $PREFIX/include/ -name "*.h" -printf "%f\n" | sort)
diff -u <(find include/ -name "*.h" -printf "%f\n" | sort) <(find "$PREFIX/include/" -name "*.h" -printf "%f\n" | sort)
if test "$?" -ne "0"; then
echo "ERROR: installed include files mismatch"
exit 1
echo "ERROR: installed include files mismatch"
exit 1
fi
echo "installcheck: installed libcurl docs and include files look good"