From 63f413891d5adc596e4d51dfba4d0d23fdea3ca4 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 31 Jul 2016 10:16:40 -0700 Subject: Stop generating a static site. --- content/post/2009-04-14-git-and-prove.md | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 content/post/2009-04-14-git-and-prove.md (limited to 'content/post/2009-04-14-git-and-prove.md') diff --git a/content/post/2009-04-14-git-and-prove.md b/content/post/2009-04-14-git-and-prove.md deleted file mode 100644 index e7585f6..0000000 --- a/content/post/2009-04-14-git-and-prove.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -date: 2009-04-14T00:00:00Z -summary: In which I add a hook to git to run my tests. -title: Git and prove ---- - -A little trick to force you to run your tests before a commit: - -in a repositorie, create the following file **.git/hooks/pre-commit** with this content: - -```sh -#!/bin/sh -if [ -d t ]; then - res=`prove t` - if [ $? -gt 0 ]; then - echo "tests fails" - exit 1 - fi -fi -if [ -d xt ]; then - res=`prove xt` - if [ $? -gt 0 ]; then - echo "tests fails" - exit 1 - fi -fi -``` - -and don't forget to chmod with +x. - -Now, when you will do your next commit, your test suit will be executed. If the tests fails, the commit will be rejected. -- cgit v1.2.3