Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8e1ec35

Browse files
committed
Use globbing for extension mapping in formatting script
The repository includes a script that formats the example sketch code. This uses a `find` command to recurse through the example folders and run the formatter on each file with a relevant extension. Previously a regular expression was used for that matching. Although perfectly functional, the same can be achieved in an easier to understand and maintain manner using globs.
1 parent 639da94 commit 8e1ec35

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎examples_formatter.sh‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# you need to have astyle installed before running this
22
find \
33
examples \
4-
-regextype posix-extended \
5-
-regex '.*\.((ino)|(h)|(cpp)|(c))$' -and \
4+
\( \
5+
-name '*.c' -or \
6+
-name '*.cpp' -or \
7+
-name '*.h' -or \
8+
-name '*.ino' \
9+
\) \
610
-type f \
711
-exec \
812
astyle \

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /