summaryrefslogtreecommitdiffstatshomepage
path: root/core/scripts/dev/commit-code-check.sh
diff options
context:
space:
mode:
authorcatch <catch@35733.no-reply.drupal.org>2023-08-02 13:53:31 +0100
committercatch <catch@35733.no-reply.drupal.org>2023-08-02 13:53:31 +0100
commit5052fcddde7744bd1f78f21bbcfe0a502bd44cd0 (patch)
tree707f3ae85969203f195922f8f99e983b01653508 /core/scripts/dev/commit-code-check.sh
parentd8ec17df74c84a1b1d17a003ce81d21cb6ab7753 (diff)
downloaddrupal-5052fcddde7744bd1f78f21bbcfe0a502bd44cd0.tar.gz
drupal-5052fcddde7744bd1f78f21bbcfe0a502bd44cd0.zip
Issue #3377131 by longwave, smustgrave: File mode check in commit-code-check.sh is too strict
Diffstat (limited to 'core/scripts/dev/commit-code-check.sh')
-rwxr-xr-xcore/scripts/dev/commit-code-check.sh9
1 files changed, 2 insertions, 7 deletions
diff --git a/core/scripts/dev/commit-code-check.sh b/core/scripts/dev/commit-code-check.sh
index 59d72b041118..a22a7808afb9 100755
--- a/core/scripts/dev/commit-code-check.sh
+++ b/core/scripts/dev/commit-code-check.sh
@@ -366,13 +366,8 @@ for FILE in $FILES; do
# Ensure the file still exists (i.e. is not being deleted).
if [ -a $FILE ]; then
if [ ${FILE: -3} != ".sh" ]; then
- # Ensure the file has the correct mode.
- STAT="$(stat -f "%A" $FILE 2>/dev/null)"
- if [ $? -ne 0 ]; then
- STAT="$(stat -c "%a" $FILE 2>/dev/null)"
- fi
- if [ "$STAT" -ne "644" ]; then
- printf "${red}check failed:${reset} file $FILE should be 644 not $STAT\n"
+ if [ -x $FILE ]; then
+ printf "${red}check failed:${reset} file $FILE should not be executable\n"
STATUS=1
fi
fi