File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 53
53
54
54
if [ " ${UNCRUST} " = 1 ]; then
55
55
# yell, rather than overwrite an innocent file
56
- if ! r2pm -r type uncrustify > /dev/null; then
57
- echo " This script requires uncrustify to function. Check r2pm -i uncrustify"
58
- exit 1
59
- fi
56
+ command -v uncrustify > /dev/null 2>&1 || {
57
+ if ! r2pm -r type uncrustify > /dev/null; then
58
+ echo " This script requires uncrustify to function. Check r2pm -i uncrustify"
59
+ exit 1
60
+ fi
61
+ }
60
62
else
61
63
# yell, rather than overwrite an innocent file
62
64
if ! type clang-format > /dev/null; then
@@ -75,7 +77,11 @@ indentFile() {
75
77
if [ " ${UNCRUST} " = 1 ]; then
76
78
cp -f doc/clang-format ${CWD} /.clang-format
77
79
cd " $CWD "
78
- r2pm -r uncrustify -c ${CWD} /doc/uncrustify.cfg -f " ${IFILE} " > .tmp-format || exit 1
80
+ if command -v uncrustify > /dev/null 2>&1 ; then
81
+ uncrustify -c ${CWD} /doc/uncrustify.cfg -f " ${IFILE} " > .tmp-format || exit 1
82
+ else
83
+ r2pm -r uncrustify -c ${CWD} /doc/uncrustify.cfg -f " ${IFILE} " > .tmp-format || exit 1
84
+ fi
79
85
else
80
86
cp -f doc/clang-format ${CWD} /.clang-format
81
87
cd " $CWD "
You can’t perform that action at this time.
0 commit comments