summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Graey <maxgraey@gmail.com>2021-07-19 23:18:04 +0300
committerGitHub <noreply@github.com>2021-07-19 13:18:04 -0700
commite8c85ea1278c3ce77af2b60b68f78a35b5c58604 (patch)
treedcb27feb412a02aeabb1f316d742551eef33c6b4
parent2d385ff8ebfcf65e3b532f4c42795758966abff4 (diff)
downloadbinaryen-e8c85ea1278c3ce77af2b60b68f78a35b5c58604.tar.gz
binaryen-e8c85ea1278c3ce77af2b60b68f78a35b5c58604.tar.bz2
binaryen-e8c85ea1278c3ce77af2b60b68f78a35b5c58604.zip
[clang-tidy-diff] Replace readlink -f to inline python script (#4001)
fix #3985
-rwxr-xr-xscripts/clang-tidy-diff.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/clang-tidy-diff.sh b/scripts/clang-tidy-diff.sh
index 9afe1824e..0e0882703 100755
--- a/scripts/clang-tidy-diff.sh
+++ b/scripts/clang-tidy-diff.sh
@@ -17,7 +17,12 @@ if [ ! -e "$CLANG_TIDY" ]; then
exit 1
fi
-CLANG_DIR=$(dirname $(dirname $(readlink -f $CLANG_TIDY)))
+# This needs for FreeBSD and Darwin which doesn't support readlink -f command
+function realpath() {
+ python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" $1;
+}
+
+CLANG_DIR=$(dirname $(dirname $(realpath $CLANG_TIDY)))
CLANG_TIDY_DIFF=$CLANG_DIR/share/clang/clang-tidy-diff.py
if [ ! -e "$CLANG_TIDY_DIFF" ]; then
echo "Failed to find clang-tidy-diff.py ($CLANG_TIDY_DIFF)"