initial commit
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_NAME="${1:-}"
|
||||
|
||||
if [[ -z "${SCRIPT_NAME}" ]]; then
|
||||
echo "Usage: $0 <script-subdirectory>" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RUNNER="${HOOK_DIR}/${SCRIPT_NAME}/run.sh"
|
||||
|
||||
if [[ ! -f "${RUNNER}" ]]; then
|
||||
echo "Hook script not found: ${RUNNER}" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ ! -x "${RUNNER}" ]]; then
|
||||
echo "Hook script is not executable: ${RUNNER}" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
exec "${RUNNER}"
|
||||
Reference in New Issue
Block a user