-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
idl: fix recompile_thrift.sh & script: add format_files.sh (#205)
- Loading branch information
HuangWei
authored and
Wu Tao
committed
Nov 2, 2018
1 parent
be693f9
commit 2544463
Showing
4 changed files
with
1,318 additions
and
1,248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
pwd="$( cd "$( dirname "$0" )" && pwd )" | ||
root_dir="$( cd $pwd/.. && pwd )" | ||
cd $root_dir | ||
|
||
linenoise=./src/shell/linenoise | ||
sds=./src/shell/sds | ||
|
||
if [ $# -eq 0 ]; then | ||
echo "formating all .h/.cpp files in $root_dir ..." | ||
find . -type f -not \( -wholename "$linenoise/*" -o -wholename "$sds/*" -o -wholename "./rocksdb/*" \) -regextype posix-egrep -regex ".*\.(cpp|h)" | xargs clang-format -i -style=file | ||
elif [ $1 = "-h" ]; then | ||
echo "USAGE: ./format-files.sh [<relative_path>] -- format .h/.cpp files in $root_dir/relative_path" | ||
echo " ./format-files.sh means format all .h/.cpp files in $root_dir" | ||
else | ||
echo "formating all .h/.cpp files in $root_dir/$1 ..." | ||
find ./$1 -type f -not \( -wholename "$linenoise/*" -o -wholename "$sds/*" -o -wholename "./rocksdb/*" \) -regextype posix-egrep -regex ".*\.(cpp|h)" | xargs clang-format -i -style=file | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.