Introduce permission checker in format checker
It check execution permission except script files
Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
done
}
+check_permission() {
+ # Check all files except script
+ FILES_TO_CHECK=()
+ for NON_SCRIPT_FILE in $(git ls-files -- . ':!:run' ':!:scripts/git-hooks/*' ':!:*.sh' ':!:*.py'); do
+ FILES_TO_CHECK+=("${NON_SCRIPT_FILE}")
+ done
+
+ if [[ ${#FILES_TO_CHECK} -eq 0 ]]; then
+ return
+ fi
+ for FILE_TO_CHECK in ${FILES_TO_CHECK[@]}; do
+ RESULT=$(stat -c '%A' ${FILE_TO_CHECK} | grep 'x')
+ if [ "${RESULT}" != "" ]; then
+ chmod a-x ${FILE_TO_CHECK}
+ fi
+ done
+}
+
check_cpp_files() {
DIRECTORIES_TO_BE_TESTED=$1
DIRECTORIES_NOT_TO_BE_TESTED=$2
fi
check_newline
+check_permission
if [[ $__Check_CPP -ne 0 ]]; then
check_cpp_tool