From de89e7b956808c19f6e3f35e93349f613f8cf5f8 Mon Sep 17 00:00:00 2001 From: tlylt Date: Sun, 7 Aug 2022 23:16:53 +0800 Subject: [PATCH 1/4] Update checkout script --- .githooks/post-checkout | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.githooks/post-checkout b/.githooks/post-checkout index c5d14bf7a4..1f660577cf 100644 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -1,7 +1,17 @@ #!/usr/bin/env sh +PREVIOUS_HEAD=$1 +NEW_HEAD=$2 +CHECKOUT_TYPE=$3 # "0" => file checkout, "1" => branch checkout + +# This is a file checkout – do nothing +if [ $CHECKOUT_TYPE == "0" ]; then exit; fi + BLUE="\033[34m" NOCOLOR="\033[0m" echo -e "${BLUE}(post-checkout) Cleaning compiled files...${NOCOLOR}" npm run clean + +echo -e "${BLUE}(post-checkout) Building backend...${NOCOLOR}" +npm run build:backend \ No newline at end of file From 9a09a9542bb1358c1538842bdd65392467bc170a Mon Sep 17 00:00:00 2001 From: tlylt Date: Sun, 7 Aug 2022 23:19:48 +0800 Subject: [PATCH 2/4] Add comment --- .githooks/post-checkout | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.githooks/post-checkout b/.githooks/post-checkout index 1f660577cf..03ba673dd9 100644 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -14,4 +14,6 @@ echo -e "${BLUE}(post-checkout) Cleaning compiled files...${NOCOLOR}" npm run clean echo -e "${BLUE}(post-checkout) Building backend...${NOCOLOR}" -npm run build:backend \ No newline at end of file +npm run build:backend + +echo -e "${BLUE}(post-checkout) Ready! Use `markbind serve -d` to serve any MarkBind sites...${NOCOLOR}" From 8d05ae56f118a89ca5728640056a9d76683ec4c5 Mon Sep 17 00:00:00 2001 From: tlylt Date: Sun, 7 Aug 2022 23:21:25 +0800 Subject: [PATCH 3/4] Update comment --- .githooks/post-checkout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.githooks/post-checkout b/.githooks/post-checkout index 03ba673dd9..99e642ec02 100644 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -16,4 +16,4 @@ npm run clean echo -e "${BLUE}(post-checkout) Building backend...${NOCOLOR}" npm run build:backend -echo -e "${BLUE}(post-checkout) Ready! Use `markbind serve -d` to serve any MarkBind sites...${NOCOLOR}" +echo -e "${BLUE}(post-checkout) Ready! Use 'markbind serve -d' to serve any MarkBind sites...${NOCOLOR}" From d77835686385498b5138a72f779f2c5d46ff98c1 Mon Sep 17 00:00:00 2001 From: tlylt Date: Tue, 9 Aug 2022 14:24:35 +0800 Subject: [PATCH 4/4] Remove unused --- .githooks/post-checkout | 2 -- 1 file changed, 2 deletions(-) diff --git a/.githooks/post-checkout b/.githooks/post-checkout index 99e642ec02..976cb6511e 100644 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -1,7 +1,5 @@ #!/usr/bin/env sh -PREVIOUS_HEAD=$1 -NEW_HEAD=$2 CHECKOUT_TYPE=$3 # "0" => file checkout, "1" => branch checkout # This is a file checkout – do nothing