From d833cd0160ca1d8d9be9828542ba6c283081430c Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Sun, 28 May 2023 15:01:49 -0700 Subject: [PATCH] shellchekc on pre-push --- pre-push | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/pre-push b/pre-push index 43fe336..5aad5a2 100755 --- a/pre-push +++ b/pre-push @@ -1,32 +1,7 @@ #!/bin/sh -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -#remote="$1" -#url="$2" - -#zero=$(git hash-object --stdin /dev/null 2> /dev/null || { echo >&2 "\nThis repository is configured for mg but 'mg' was not found on your path. Install it with go install github.com/taigrr/mg/cmd/mg@latest or remove this code from your templates in ~/.config/git/hooks.\n"; exit 2; } && mg register >/dev/null & +which mg >/dev/null 2> /dev/null || { printf >&2 "\nThis repository is configured for mg but 'mg' was not found on your path. Install it with go install github.com/taigrr/mg/cmd/mg@latest or remove this code from your templates in ~/.config/git/hooks.\n"; exit 2; } && mg register >/dev/null & test "$(git lfs track | wc -l)" -gt 0 || exit 0 -command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/pre-push' and your templates in ~/.config/git/hooks.\n"; exit 2; } +command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/pre-push' and your templates in ~/.config/git/hooks.\n"; exit 2; } git lfs pre-push "$@"