mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 14:29:19 +08:00
feat(main): 🚀 Database Name Correction and S3 Module Int32 Overflow Fix with Go Routine Integration for Automated Checks and Script Optimization (#1799)
* feat: replace mongo database openIM_v3 to openim_v3 * openim-building-an-efficient-version-control-and-testing-workflow * feat: complete openim source deployment rpc start timeout * feat: optimize config Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> * feat: add scripts format * feat: use scripts format code * fix cos and minio etc to typecheck * feat: scripts make verify check ci * fix: make file verify spelling * fix: make file verify spelling * Concurrent Type Checking and Cross-Platform Development in Go * feat: add copyright make lint and format * feat: add config examples file Signed-off-by: Xinwei Xiong <3293172751@qq.com> * feat: add config examples file Signed-off-by: Xinwei Xiong <3293172751@qq.com> --------- Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> Signed-off-by: Xinwei Xiong <3293172751@qq.com>
This commit is contained in:
+48
-48
@@ -39,62 +39,62 @@ OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
HOOKS_DIR="${OPENIM_ROOT}/.git/hooks"
|
||||
|
||||
help_info() {
|
||||
echo "Usage: $0 [options]"
|
||||
echo
|
||||
echo "This script helps to manage git hooks."
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -h, --help Show this help message and exit."
|
||||
echo " -d, --delete Delete the hooks that have been added."
|
||||
echo " By default, it will prompt to enable git hooks."
|
||||
echo "Usage: $0 [options]"
|
||||
echo
|
||||
echo "This script helps to manage git hooks."
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -h, --help Show this help message and exit."
|
||||
echo " -d, --delete Delete the hooks that have been added."
|
||||
echo " By default, it will prompt to enable git hooks."
|
||||
}
|
||||
|
||||
delete_hooks() {
|
||||
for file in ${OPENIM_ROOT}/scripts/githooks/*.sh; do
|
||||
hook_name=$(basename "$file" .sh) # This removes the .sh extension
|
||||
rm -f "$HOOKS_DIR/$hook_name"
|
||||
done
|
||||
echo "Git hooks have been deleted."
|
||||
for file in "${OPENIM_ROOT}"/scripts/githooks/*.sh; do
|
||||
hook_name=$(basename "$file" .sh) # This removes the .sh extension
|
||||
rm -f "$HOOKS_DIR/$hook_name"
|
||||
done
|
||||
echo "Git hooks have been deleted."
|
||||
}
|
||||
|
||||
enable_hooks() {
|
||||
echo "Would you like to:"
|
||||
echo "1) Enable git hooks mode"
|
||||
echo "2) Delete existing git hooks"
|
||||
echo "Please select a number (or any other key to exit):"
|
||||
read -r choice
|
||||
|
||||
case "$choice" in
|
||||
1)
|
||||
for file in ${OPENIM_ROOT}/scripts/githooks/*.sh; do
|
||||
hook_name=$(basename "$file" .sh) # This removes the .sh extension
|
||||
cp -f "$file" "$HOOKS_DIR/$hook_name"
|
||||
done
|
||||
|
||||
chmod +x $HOOKS_DIR/*
|
||||
|
||||
echo "Git hooks mode has been enabled."
|
||||
echo "With git hooks enabled, every time you perform a git action (e.g. git commit), the corresponding hooks script will be triggered automatically."
|
||||
echo "This means that if the size of the file you're committing exceeds the set limit (e.g. 42MB), the commit will be rejected."
|
||||
;;
|
||||
2)
|
||||
delete_hooks
|
||||
;;
|
||||
*)
|
||||
echo "Exiting without making changes."
|
||||
;;
|
||||
esac
|
||||
echo "Would you like to:"
|
||||
echo "1) Enable git hooks mode"
|
||||
echo "2) Delete existing git hooks"
|
||||
echo "Please select a number (or any other key to exit):"
|
||||
read -r choice
|
||||
|
||||
case "$choice" in
|
||||
1)
|
||||
for file in ${OPENIM_ROOT}/scripts/githooks/*.sh; do
|
||||
hook_name=$(basename "$file" .sh) # This removes the .sh extension
|
||||
cp -f "$file" "$HOOKS_DIR/$hook_name"
|
||||
done
|
||||
|
||||
chmod +x $HOOKS_DIR/*
|
||||
|
||||
echo "Git hooks mode has been enabled."
|
||||
echo "With git hooks enabled, every time you perform a git action (e.g. git commit), the corresponding hooks script will be triggered automatically."
|
||||
echo "This means that if the size of the file you're committing exceeds the set limit (e.g. 42MB), the commit will be rejected."
|
||||
;;
|
||||
2)
|
||||
delete_hooks
|
||||
;;
|
||||
*)
|
||||
echo "Exiting without making changes."
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
help_info
|
||||
;;
|
||||
-d|--delete)
|
||||
delete_hooks
|
||||
;;
|
||||
*)
|
||||
enable_hooks
|
||||
;;
|
||||
-h|--help)
|
||||
help_info
|
||||
;;
|
||||
-d|--delete)
|
||||
delete_hooks
|
||||
;;
|
||||
*)
|
||||
enable_hooks
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user