Scaffold Cloudron packaging workspace and automation
This commit is contained in:
16
scripts/hooks/install_hooks.sh
Executable file
16
scripts/hooks/install_hooks.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
|
||||
HOOK_DIR="${REPO_ROOT}/.git/hooks"
|
||||
|
||||
if [[ ! -d "${HOOK_DIR}" ]]; then
|
||||
echo "This script must be run inside a git repository." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for hook in pre-commit post-commit pre-push; do
|
||||
ln -sf "${REPO_ROOT}/scripts/hooks/${hook}" "${HOOK_DIR}/${hook}"
|
||||
chmod +x "${HOOK_DIR}/${hook}"
|
||||
echo "Installed ${hook} hook"
|
||||
done
|
Reference in New Issue
Block a user