mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-09-26 07:14:11 +08:00
24 lines
515 B
Bash
Executable File
24 lines
515 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ! -x "$(which clang-format-3.9)" ]; then
|
|
# If clang-format is not version -3.9, just use clang-format
|
|
CLANGFORMAT=clang-format make prettyprint
|
|
else
|
|
CLANGFORMAT=clang-format-3.9 make prettyprint
|
|
fi;
|
|
|
|
modified=$(git status -s)
|
|
|
|
if [ "$modified" ]; then
|
|
tput setaf 1;
|
|
echo "Code does not adhere to the project standards. Run \"make prettyprint\".";
|
|
tput sgr 0;
|
|
git status -s
|
|
exit 1;
|
|
else
|
|
tput setaf 2;
|
|
echo "Code adheres to the project standards (prettyprint).";
|
|
tput sgr 0;
|
|
exit 0;
|
|
fi;
|