From e1daac32c5b7ca0d902c16135d361aa5303f5124 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 27 Jan 2013 15:00:27 +0100 Subject: o Creating an initial version of install-file. --- libexec/app-run-hook | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 libexec/app-run-hook (limited to 'libexec/app-run-hook') diff --git a/libexec/app-run-hook b/libexec/app-run-hook new file mode 100755 index 0000000..ec96c58 --- /dev/null +++ b/libexec/app-run-hook @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e +set -u + +APPSH_HOME=$(cd $(dirname "$0")/.. && pwd) + +. $APPSH_HOME/lib/common +# HEADER END + +usage() { + echo "usage: $usage_app -v [version] -h [hook]" 2>&1 +} + +version= +hook= + +while getopts "v:h:" opt +do + case $opt in + v) + version=$OPTARG + shift 2 + OPTIND=1 + ;; + h) + hook=$OPTARG + shift 2 + OPTIND=1 + ;; + esac +done + +if [[ -z $version || -z $hook || $# != 0 ]] +then + usage +fi + +bin=versions/$version/hooks/$hook + +if [[ ! -r $bin ]] +then + exit 0 +fi + +# TODO: remove after +#chmod +x $bin +echo "Running hook: $hook" +run_app -v $version hooks/$hook -- cgit v1.2.3