From 41f77bf46fc97cbcb810153b42b276447e05e933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0pa=C4=8Dek?= Date: Wed, 27 Nov 2024 02:58:11 +0100 Subject: [PATCH] Set exec bit for files that have the exec bit in Git --- app/bin/set-file-mode-bits.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/bin/set-file-mode-bits.sh b/app/bin/set-file-mode-bits.sh index a04cb2305..6f187bed9 100755 --- a/app/bin/set-file-mode-bits.sh +++ b/app/bin/set-file-mode-bits.sh @@ -1,4 +1,11 @@ #!/bin/sh -SITEDIR="$(dirname "$0")/.." -chmod --verbose a+w "$SITEDIR/../uploads/" "$SITEDIR/log/" "$SITEDIR/temp/" "$SITEDIR/public/www.michalspacek.cz/i/build/" +# Writable dirs +ROOT_DIR="$(realpath "$(dirname "$0")/../..")" +chmod --verbose a+w "$ROOT_DIR/uploads/" "$ROOT_DIR/app/log/" "$ROOT_DIR/app/temp/" "$ROOT_DIR/app/public/www.michalspacek.cz/i/build/" + +# Executable files +FILES=$(git ls-files --stage | grep "^100755" | grep --only-matching --perl-regexp "(?<=\t).*$") +for FILE in $FILES; do + chmod a+x "$FILE" +done