mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-07 03:35:48 +08:00
feat: complete the githook design
Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
parent
b9dc4d302e
commit
4d78ab0de3
36
script/githooks/pre-push
Normal file
36
script/githooks/pre-push
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
YELLOW="\e[93m"
|
||||||
|
GREEN="\e[32m"
|
||||||
|
RED="\e[31m"
|
||||||
|
ENDCOLOR="\e[0m"
|
||||||
|
|
||||||
|
printMessage() {
|
||||||
|
printf "${YELLOW}OpenIM : $1${ENDCOLOR}\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
printSuccess() {
|
||||||
|
printf "${GREEN}OpenIM : $1${ENDCOLOR}\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
printError() {
|
||||||
|
printf "${RED}OpenIM : $1${ENDCOLOR}\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
printMessage "Running local OpenIM pre-push hook."
|
||||||
|
|
||||||
|
if [[ `git status --porcelain` ]]; then
|
||||||
|
printError "This script needs to run against committed code only. Please commit or stash you changes."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
#printMessage "Running the Flutter analyzer"
|
||||||
|
#flutter analyze
|
||||||
|
#
|
||||||
|
#if [ $? -ne 0 ]; then
|
||||||
|
# printError "Flutter analyzer error"
|
||||||
|
# exit 1
|
||||||
|
#fi
|
||||||
|
#
|
||||||
|
#printMessage "Finished running the Flutter analyzer"
|
Loading…
x
Reference in New Issue
Block a user