聊天样式微调
This commit is contained in:
1 parent
fafcdfe742
commit
efae286f5c
12 files changed
+442
-293
No files matched your search
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
|
||||
if ! git -C "${ROOT_DIR}" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
echo "[hook-install] ${ROOT_DIR} is not a git repository."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HOOK_PATH="${ROOT_DIR}/.githooks/pre-commit"
|
||||
if [[ ! -f "${HOOK_PATH}" ]]; then
|
||||
echo "[hook-install] missing hook file: ${HOOK_PATH}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
chmod +x "${HOOK_PATH}"
|
||||
if ! git -C "${ROOT_DIR}" config core.hooksPath .githooks; then
|
||||
echo "[hook-install] failed to set git config core.hooksPath."
|
||||
echo "[hook-install] please run manually in your local shell:"
|
||||
echo " git config core.hooksPath .githooks"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[hook-install] Installed pre-commit hook successfully."
|
||||
echo "[hook-install] core.hooksPath=$(git -C "${ROOT_DIR}" config --get core.hooksPath)"
|
||||
Reference in new issue
Block a user