Fix bug in namcapAnalysis() and add printWarning()
This commit is contained in:
parent
9a4f4d4f6a
commit
48e6032801
19
pkgbuild.sh
19
pkgbuild.sh
|
@ -28,15 +28,26 @@ exportFile() {
|
||||||
namcapAnalysis() {
|
namcapAnalysis() {
|
||||||
pacman -S --noconfirm namcap
|
pacman -S --noconfirm namcap
|
||||||
|
|
||||||
namcapOutput=$(namcap PKGBUILD)
|
mapfile -t warnings < <(namcap PKGBUILD)
|
||||||
[ -n "$namcapOutput" ] && echo "::warning::$namcapOutput HOLA"
|
printWarnings "PKGBUILD"
|
||||||
if [ -f "$pkgFile" ]; then
|
if [ -f "$pkgFile" ]; then
|
||||||
relPkgFile="$(realpath --relative-base="$baseDir" "$pkgFile")"
|
relPkgFile="$(realpath --relative-base="$baseDir" "$pkgFile")"
|
||||||
namcapOutput=$(namcap "$pkgFile")
|
mapfile -t warnings < <(namcap "$pkgFile")
|
||||||
[ -n "$namcapOutput" ] && echo "::warning::$relPkgFile:$namcapOutput CHAU"
|
# [ ${#warnings[@]} -eq 0 ] && return
|
||||||
|
# for warning in "${warnings[@]}"; do
|
||||||
|
# echo "::warning::$relPkgFile:$warning"
|
||||||
|
# done
|
||||||
|
printWarnings "$relPkgFile"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printWarnings() {
|
||||||
|
[ ${#warnings[@]} -eq 0 ] && return
|
||||||
|
for warning in "${warnings[@]}"; do
|
||||||
|
echo "::warning::$1:$warning"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
runScript() {
|
runScript() {
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue