Skip to content

Commit 124bead

Browse files
committed
Make formatter script check availability of tool
The repository includes a script that formats the code in the examples. When running this script locally, the contributor must have the formatter tool installed and in the system PATH. Previously this dependency was only explained by a comment in the script, which is not likely to be seen by the contributor in advance of running it. This means they would encounter a somewhat cryptic error message. A more contributor friendly approach is for the script to check for the availability of the tool, then exit with a friendly error message if it is not found.
1 parent dac0093 commit 124bead

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples_formatter.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# you need to have astyle installed before running this
1+
if ! which astyle &>/dev/null; then
2+
echo "astyle not found or not in PATH. Please install: https://astyle.sourceforge.net/install.html"
3+
exit 1
4+
fi
5+
26
find \
37
examples \
48
\( \

0 commit comments

Comments
 (0)