Skip to content

Commit

Permalink
Refresh check_buck_targets.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mszeszko-meta committed Dec 6, 2024
1 parent be7703b commit 0984ac1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions buckifier/check_buck_targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
# 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`
TGT_DIFF=`git diff BUCK | head -n 1`

if [ ! -z "$TGT_DIFF" ]
then
echo "TARGETS file has uncommitted changes. Skip this check."
echo "BUCK file has uncommitted changes. Skip this check."
exit 0
fi

echo Backup original TARGETS file.
echo Backup original BUCK file.

cp TARGETS TARGETS.bkp
cp BUCK BUCK.bkp

${PYTHON:-python3} buckifier/buckify_rocksdb.py

TGT_DIFF=`git diff TARGETS | head -n 1`
TGT_DIFF=`git diff BUCK | head -n 1`

if [ -z "$TGT_DIFF" ]
then
mv TARGETS.bkp TARGETS
mv BUCK.bkp BUCK
exit 0
else
echo "Please run '${PYTHON:-python3} buckifier/buckify_rocksdb.py' to update TARGETS file."
echo "Do not manually update TARGETS file."
echo "Please run '${PYTHON:-python3} buckifier/buckify_rocksdb.py' to update BUCK file."
echo "Do not manually update BUCK file."
${PYTHON:-python3} --version
mv TARGETS.bkp TARGETS
mv BUCK.bkp BUCK
exit 1
fi

0 comments on commit 0984ac1

Please sign in to comment.