From f516f6f9d515674bebaa1a874f945bd53f4561c6 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Wed, 18 Nov 2020 21:37:54 +0000 Subject: [PATCH] --- git-hooks.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/git-hooks.md b/git-hooks.md index ea7fd36..62322b7 100644 --- a/git-hooks.md +++ b/git-hooks.md @@ -1,4 +1,12 @@ -Put the following in `.git/modules/public/hooks/pre-commit`: +Put the following in `.git/hooks/pre-commit`: + +```shell +#!/bin/sh + +for file in $(git status --porcelain --untracked=all | cut -b 4- | grep "\.png$") ; do pngcrush -brute -ow $file; done +``` + +And in `.git/modules/public/hooks/pre-commit`: ```shell #!/bin/sh