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 3737 find "$SOURCE_DIR" -type f \( -name "*.f" -o -name "*.f90" -o -name "*.for" -o -name "*.fpp" -o -name "*.F" -o -name "*.F90" \) -print0 |
3838 while IFS= read -r -d $'\0' file; do
3939 processed=$((processed + 1))
40- echo -e "[$processed/$total_files] Processing ${file}..."
4140
4241 # Create a temporary file with same permissions as original
4342 TMP_FILE=$(mktemp)
@@ -106,23 +105,21 @@ jobs:
106105 s/[[:space:]]*>[[:space:]]*/>/g
107106 s/[[:space:]]*==[[:space:]]*/==/g
108107
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
114113
115114 # Remove end-of-line comments, preserving quoted strings
116115 s/([^"'\''\\]*("[^"]*")?('\''[^'\'']*'\''?)?[^"'\''\\]*)[!].*$/\1/
117116 ' "$file" > "$TMP_FILE"
118-
117+
119118 if cmp -s "$file" "$TMP_FILE"; then
120- echo -e "No changes needed for $file"
121119 rm "$TMP_FILE"
122120 else
123121 # Overwrite the original file with the processed content
124122 mv "$TMP_FILE" "$file"
125- echo -e "Successfully processed $file"
126123 fi
127124 done
128125
You can’t perform that action at this time.
0 commit comments