From f2963c98c5a74684177590e5a532d4ec18496711 Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Tue, 22 Jan 2019 21:07:47 +0200 Subject: [PATCH] chore(qa): add separate git hook for build + flow --- .githooks/pre-commit.8.test.sh | 3 +-- .githooks/pre-commit.9.build.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .githooks/pre-commit.9.build.sh diff --git a/.githooks/pre-commit.8.test.sh b/.githooks/pre-commit.8.test.sh index 2dcf445e..57f5aa42 100755 --- a/.githooks/pre-commit.8.test.sh +++ b/.githooks/pre-commit.8.test.sh @@ -4,6 +4,5 @@ set -e if [ -n "$JS_STAGED" ] || [ -n "$SNAPSHOT_STAGED" ]; then - npx flow - npm run test:coverage -s + npm run test:coverage -s fi diff --git a/.githooks/pre-commit.9.build.sh b/.githooks/pre-commit.9.build.sh new file mode 100644 index 00000000..96eaab2e --- /dev/null +++ b/.githooks/pre-commit.9.build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +FLOW_STAGED=$(grep -e '.flowconfig$' <<< "$STAGED" || true) + +if [ -n "$JS_STAGED" ] || [ -n "$FLOW_STAGED" ]; +then + npm run dist + npx flow +fi