Restore basedir format.sh behavior

Summary: Ensure that `format.sh` can be run from anywhere with the same results.

Reviewed By: emilsjolander

Differential Revision: D4494367

fbshipit-source-id: cbd2cc36476a0a54a77a732cbe1b79388f7e0c46
This commit is contained in:
Pascal Hartig
2017-02-01 02:37:11 -08:00
committed by Facebook Github Bot
parent 326ae15532
commit bd5d8a77c9

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
FILES=$(find . \( -path ./buck-out -o -path ./lib \) -prune -o \
BASEDIR="$(dirname "$0")"
FILES=$(find "$BASEDIR" \( -path "$BASEDIR/buck-out" -o -path "$BASEDIR/lib" \) -prune -o \
\( -name \*.h -o -name \*.c -o -name \*.cpp \) -print)
for f in $FILES "$@"; do