From bd5d8a77c999dd022b77ce2710ff0c9b967557e6 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 1 Feb 2017 02:37:11 -0800 Subject: [PATCH] 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 --- format.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/format.sh b/format.sh index 184c2635..d1bbb9c0 100755 --- a/format.sh +++ b/format.sh @@ -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