2020-05-01 02:20:55 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
|
|
|
# If clang_format_diff.py command is not specfied, we assume we are able to
|
|
|
|
# access directly without any path.
|
|
|
|
|
|
|
|
TGT_DIFF=`git diff TARGETS | head -n 1`
|
|
|
|
|
|
|
|
if [ ! -z "$TGT_DIFF" ]
|
|
|
|
then
|
|
|
|
echo "TARGETS file has uncommitted changes. Skip this check."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo Backup original TARGETS file.
|
|
|
|
|
|
|
|
cp TARGETS TARGETS.bkp
|
|
|
|
|
2020-05-29 18:24:19 +00:00
|
|
|
${PYTHON:-python3} buckifier/buckify_rocksdb.py
|
2020-05-01 02:20:55 +00:00
|
|
|
|
|
|
|
TGT_DIFF=`git diff TARGETS | head -n 1`
|
|
|
|
|
|
|
|
if [ -z "$TGT_DIFF" ]
|
|
|
|
then
|
|
|
|
mv TARGETS.bkp TARGETS
|
|
|
|
exit 0
|
|
|
|
else
|
2020-05-29 18:24:19 +00:00
|
|
|
echo "Please run '${PYTHON:-python3} buckifier/buckify_rocksdb.py' to update TARGETS file."
|
2020-05-01 02:20:55 +00:00
|
|
|
echo "Do not manually update TARGETS file."
|
2020-05-29 18:24:19 +00:00
|
|
|
${PYTHON:-python3} --version
|
2020-05-01 02:20:55 +00:00
|
|
|
mv TARGETS.bkp TARGETS
|
|
|
|
exit 1
|
|
|
|
fi
|