summaryrefslogtreecommitdiff
path: root/fix-stm32cubemx-files
diff options
context:
space:
mode:
Diffstat (limited to 'fix-stm32cubemx-files')
-rwxr-xr-xfix-stm32cubemx-files15
1 files changed, 15 insertions, 0 deletions
diff --git a/fix-stm32cubemx-files b/fix-stm32cubemx-files
new file mode 100755
index 0000000..141d4a1
--- /dev/null
+++ b/fix-stm32cubemx-files
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+find stm32cubemx -type f |while read file
+do
+ cat $file | dos2unix | sed 's, *$,,g' > $file.tmp
+ cnt=$(diff $file.tmp $file | wc -l)
+
+ if [[ $cnt -gt 0 ]]
+ then
+ echo Fixed $file
+ mv $file.tmp $file
+ else
+ rm $file.tmp
+ fi
+done