File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 37
37
find "$SOURCE_DIR" -type f \( -name "*.f" -o -name "*.f90" -o -name "*.for" -o -name "*.fpp" -o -name "*.F" -o -name "*.F90" \) -print0 |
38
38
while IFS= read -r -d $'\0' file; do
39
39
processed=$((processed + 1))
40
- echo -e "[$processed/$total_files] Processing ${file}..."
41
40
42
41
# Create a temporary file with same permissions as original
43
42
TMP_FILE=$(mktemp)
@@ -106,23 +105,21 @@ jobs:
106
105
s/[[:space:]]*>[[:space:]]*/>/g
107
106
s/[[:space:]]*==[[:space:]]*/==/g
108
107
109
- # Remove full-line comments
110
- /^\s*!/d
111
- /^[cC*dD]/d
112
- /^[ \t]*[cC*dD]/d
113
- /^[[:space:]]*$/d
108
+ # Remove full-line comments
109
+ /^\s*!/d
110
+ /^[cC*dD]/d
111
+ /^[ \t]*[cC*dD]/d
112
+ /^[[:space:]]*$/d
114
113
115
114
# Remove end-of-line comments, preserving quoted strings
116
115
s/([^"'\''\\]*("[^"]*")?('\''[^'\'']*'\''?)?[^"'\''\\]*)[!].*$/\1/
117
116
' "$file" > "$TMP_FILE"
118
-
117
+
119
118
if cmp -s "$file" "$TMP_FILE"; then
120
- echo -e "No changes needed for $file"
121
119
rm "$TMP_FILE"
122
120
else
123
121
# Overwrite the original file with the processed content
124
122
mv "$TMP_FILE" "$file"
125
- echo -e "Successfully processed $file"
126
123
fi
127
124
done
128
125
You can’t perform that action at this time.
0 commit comments