From d119c8d1f5b18c6ee9c5efa90615427083875e00 Mon Sep 17 00:00:00 2001 From: Przemyslaw Pawelczyk Date: Tue, 19 Jan 2016 20:42:22 +0100 Subject: examples: Move hook scripts to their own subdirectory. --- examples/hooks/post-checkout | 24 ++++++++++++++++++++++++ examples/hooks/pre-commit | 27 +++++++++++++++++++++++++++ examples/post-checkout | 24 ------------------------ examples/pre-commit | 27 --------------------------- 4 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 examples/hooks/post-checkout create mode 100644 examples/hooks/pre-commit delete mode 100644 examples/post-checkout delete mode 100644 examples/pre-commit diff --git a/examples/hooks/post-checkout b/examples/hooks/post-checkout new file mode 100644 index 0000000..bd4de15 --- /dev/null +++ b/examples/hooks/post-checkout @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to set metadata information using +# metastore after each checkout. + +MSFILE=".metadata" + +exit_on_fail() { + "$@" + if [ $? -ne 0 ]; then + echo "Failed to execute: $@" >&2 + exit 1 + fi +} + +if [ ! -e "$MSFILE" ]; then + echo "\"$MSFILE\" missing" >&2 + exit 1 +fi + +exit_on_fail \ + metastore -a -m -e -E -q -f "$MSFILE" + +exit 0 diff --git a/examples/hooks/pre-commit b/examples/hooks/pre-commit new file mode 100644 index 0000000..b91635d --- /dev/null +++ b/examples/hooks/pre-commit @@ -0,0 +1,27 @@ +#!/bin/sh +# +# An example hook script to store metadata information using +# metastore on each commit. + +MSFILE=".metadata" + +exit_on_fail() { + "$@" + if [ $? -ne 0 ]; then + echo "Failed to execute: $@" >&2 + exit 1 + fi +} + +exit_on_fail \ + metastore -s -f "$MSFILE" + +if [ ! -e "$MSFILE" ]; then + echo "\"$MSFILE\" missing" >&2 + exit 1 +fi + +exit_on_fail \ + git-add "$MSFILE" + +exit 0 diff --git a/examples/post-checkout b/examples/post-checkout deleted file mode 100644 index bd4de15..0000000 --- a/examples/post-checkout +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to set metadata information using -# metastore after each checkout. - -MSFILE=".metadata" - -exit_on_fail() { - "$@" - if [ $? -ne 0 ]; then - echo "Failed to execute: $@" >&2 - exit 1 - fi -} - -if [ ! -e "$MSFILE" ]; then - echo "\"$MSFILE\" missing" >&2 - exit 1 -fi - -exit_on_fail \ - metastore -a -m -e -E -q -f "$MSFILE" - -exit 0 diff --git a/examples/pre-commit b/examples/pre-commit deleted file mode 100644 index b91635d..0000000 --- a/examples/pre-commit +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# -# An example hook script to store metadata information using -# metastore on each commit. - -MSFILE=".metadata" - -exit_on_fail() { - "$@" - if [ $? -ne 0 ]; then - echo "Failed to execute: $@" >&2 - exit 1 - fi -} - -exit_on_fail \ - metastore -s -f "$MSFILE" - -if [ ! -e "$MSFILE" ]; then - echo "\"$MSFILE\" missing" >&2 - exit 1 -fi - -exit_on_fail \ - git-add "$MSFILE" - -exit 0 -- cgit v1.2.1