File tree 3 files changed +5
-8
lines changed
3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 20
20
21
21
SCRIPT_PATH=$( dirname $0 )
22
22
CONFIG=" $SCRIPT_PATH /uncrustify.cfg"
23
+ EXE=" $SCRIPT_PATH /../node_modules/.bin/uncrustify"
23
24
24
25
function Usage() {
25
26
echo " Formats code using uncrustify."
@@ -32,7 +33,7 @@ function Usage() {
32
33
}
33
34
34
35
function VerifyEnv() {
35
- if ! which uncrustify > /dev/null; then
36
+ if ! which " $EXE " > /dev/null; then
36
37
echo " uncrustify binary not found. Please ensure that it is in your PATH."
37
38
echo " Install via homebrew using: brew install uncrustify"
38
39
exit 1
@@ -77,7 +78,7 @@ elif [[ "$1" = "--all" ]]; then
77
78
files=$( find .)
78
79
FilterAndRun $files
79
80
elif [[ " $1 " = " --check-file" ]]; then
80
- uncrustify -q -l OC -c " $CONFIG " -f " $2 " | cmp --quiet - " $2 "
81
+ " $EXE " -q -l OC -c " $CONFIG " -f " $2 " | cmp --quiet - " $2 "
81
82
elif [[ " $1 " = " --filter" ]]; then
82
83
FilterFileList " $@ "
83
84
elif [[ " $1 " = -* ]]; then
Original file line number Diff line number Diff line change @@ -24,11 +24,6 @@ PATH=$PATH:/usr/local/bin:/usr/local/sbin
24
24
exec 1>&2
25
25
test $SKIP_UNCRUSTIFY && exit 0
26
26
27
- if [[ " $( uncrustify --version | cut -d' ' -f2) " != 0.60 ]]; then
28
- echo " Please install version 0.60 of uncrustify."
29
- exit 1
30
- fi
31
-
32
27
RET=0
33
28
files=$( bin/uncrustify.sh --filter $( git diff --cached --name-only) )
34
29
MSGS=
Original file line number Diff line number Diff line change 27
27
"nodeunit" : " ^0.8.7"
28
28
},
29
29
"devDependencies" : {
30
- "jshint" : " ^2.6.0"
30
+ "jshint" : " ^2.6.0" ,
31
+ "uncrustify" : " ^0.6.1"
31
32
}
32
33
}
You can’t perform that action at this time.
0 commit comments