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