From 4d78ab0de35f13ff7a00d085d19c961687d0a1f9 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw)" <3293172751nss@gmail.com> Date: Sat, 13 May 2023 17:49:01 +0800 Subject: [PATCH] feat: complete the githook design Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> --- script/githooks/pre-push | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 script/githooks/pre-push diff --git a/script/githooks/pre-push b/script/githooks/pre-push new file mode 100644 index 000000000..3402ac656 --- /dev/null +++ b/script/githooks/pre-push @@ -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"