forked from esp8266/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrestyle.sh
executable file
·50 lines (42 loc) · 984 Bytes
/
restyle.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
set -e
org=$(cd ${0%/*}; pwd)
cd ${org}/..
pwd
test -d cores/esp8266
test -d libraries
# should be: all="cores/esp8266 libraries"
all="
libraries/ESP8266mDNS
libraries/Wire
libraries/lwIP*
cores/esp8266/Lwip*
cores/esp8266/debug*
cores/esp8266/core_esp8266_si2c.cpp
cores/esp8266/StreamString.*
cores/esp8266/StreamSend.*
libraries/Netdump
"
# core
for d in $all; do
if [ -d "$d" ]; then
echo "-------- directory $d:"
for e in c cpp h; do
find $d -name "*.$e" -exec \
astyle \
--suffix=none \
--options=${org}/astyle_core.conf {} \;
done
else
echo "-------- file $d:"
astyle --suffix=none --options=${org}/astyle_core.conf "$d"
fi
done
# examples
for d in libraries; do
echo "-------- examples in $d:"
find $d -name "*.ino" -exec \
astyle \
--suffix=none \
--options=${org}/astyle_examples.conf {} \;
done