From 8ea48a742b423c64f9345f82b43365a333fa7f6f Mon Sep 17 00:00:00 2001 From: DavHau Date: Fri, 4 Feb 2022 09:56:51 +0700 Subject: [PATCH] only execute pre-commit hook on master --- git-hooks/pre-commit | 7 +++++-- mach_nix/VERSION | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index a5d91dc..af2df25 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -1,4 +1,7 @@ #!/usr/bin/env bash -echo -n "$(git branch --show-current)" > ./mach_nix/VERSION -git add ./mach_nix/VERSION +currBranch="$(git branch --show-current)" +if [ $currBranch == "master" ]; then + echo -n "$currBranch" > ./mach_nix/VERSION + git add ./mach_nix/VERSION +fi diff --git a/mach_nix/VERSION b/mach_nix/VERSION index 2cece57..8b25206 100644 --- a/mach_nix/VERSION +++ b/mach_nix/VERSION @@ -1 +1 @@ -macos-arm64 \ No newline at end of file +master \ No newline at end of file