Skip to content

Commit 2588a80

Browse files
committed
CB-8506 - Use npm version of uncrustify in cordova-ios
1 parent 7422425 commit 2588a80

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

bin/uncrustify.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
SCRIPT_PATH=$(dirname $0)
2222
CONFIG="$SCRIPT_PATH/uncrustify.cfg"
23+
EXE="$SCRIPT_PATH/../node_modules/.bin/uncrustify"
2324

2425
function Usage() {
2526
echo "Formats code using uncrustify."
@@ -32,7 +33,7 @@ function Usage() {
3233
}
3334

3435
function VerifyEnv() {
35-
if ! which uncrustify > /dev/null; then
36+
if ! which "$EXE" > /dev/null; then
3637
echo "uncrustify binary not found. Please ensure that it is in your PATH."
3738
echo "Install via homebrew using: brew install uncrustify"
3839
exit 1
@@ -77,7 +78,7 @@ elif [[ "$1" = "--all" ]]; then
7778
files=$(find .)
7879
FilterAndRun $files
7980
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"
8182
elif [[ "$1" = "--filter" ]]; then
8283
FilterFileList "$@"
8384
elif [[ "$1" = -* ]]; then

hooks/pre-commit

-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ PATH=$PATH:/usr/local/bin:/usr/local/sbin
2424
exec 1>&2
2525
test $SKIP_UNCRUSTIFY && exit 0
2626

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-
3227
RET=0
3328
files=$(bin/uncrustify.sh --filter $(git diff --cached --name-only))
3429
MSGS=

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"nodeunit": "^0.8.7"
2828
},
2929
"devDependencies": {
30-
"jshint": "^2.6.0"
30+
"jshint": "^2.6.0",
31+
"uncrustify": "^0.6.1"
3132
}
3233
}

0 commit comments

Comments
 (0)