mbedtls/scripts/gitignore_remove_generated_files.sh
Agathiyan Bragadeesh cf3554b4e8 Update file permissions
New scripts have updated executable permissions to be consistent with
project requirements.

Signed-off-by: Agathiyan Bragadeesh <agabra02@e127300.arm.com>
2023-07-06 18:10:19 +01:00

24 lines
630 B
Bash
Executable File

#!/bin/bash
set -eu
GITIGNORES=$(find . -name ".gitignore")
for GITIGNORE in $GITIGNORES; do
IN_GEN_BLOCK=false
while read -r line; do
if [ "$line" = "###START_GENERATED_FILES###" ]; then
IN_GEN_BLOCK=true
echo "###START_COMMENTED_GENERATED_FILES###"
elif [ "$line" = "###END_GENERATED_FILES###" ]; then
IN_GEN_BLOCK=false
echo "###END_COMMENTED_GENERATED_FILES###"
elif $IN_GEN_BLOCK ; then
echo "#$line"
else
echo "$line"
fi
done <$GITIGNORE > "$GITIGNORE.tmp"
mv "$GITIGNORE.tmp" $GITIGNORE
done