From d30fc65dd59b7b9be9159fbcd257f5c42405f762 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Tue, 17 May 2022 15:28:41 +0200 Subject: [PATCH] add check for +x flag --- .github/checks/Makefile | 7 +++++-- .github/checks/noexec.sh | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100755 .github/checks/noexec.sh diff --git a/.github/checks/Makefile b/.github/checks/Makefile index 52d6611aa..18cc153d4 100644 --- a/.github/checks/Makefile +++ b/.github/checks/Makefile @@ -1,7 +1,7 @@ -.PHONY: check tabs lastline spaces +.PHONY: checkstyle tabs lastline spaces noexec -checkstyle: tabs lastline spaces +checkstyle: tabs lastline spaces noexec tabs: tabs.sh @./tabs.sh @@ -11,3 +11,6 @@ lastline: lastline.sh spaces: spaces.sh @./spaces.sh + +noexec: noexec.sh + @./noexec.sh diff --git a/.github/checks/noexec.sh b/.github/checks/noexec.sh new file mode 100755 index 000000000..c76ae481d --- /dev/null +++ b/.github/checks/noexec.sh @@ -0,0 +1,18 @@ +#! /bin/bash +OLDCWD=`pwd` +SCRIPT_PATH=`dirname $0` +CHECK_PATH=. + +cd $SCRIPT_PATH/../../ + +FILES=`find $CHECK_PATH -executable -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print` + +cd $OLDCWD + +if [ x"$FILES"x != xx ]; then + echo "error: executable flag is set for the following files:" >&2 + for n in $FILES; do + echo $n >&2 + done + exit -1 +fi