mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 09:36:00 +08:00
feat: set openim lint
Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
+30
-28
@@ -32,39 +32,41 @@ if [[ $? -ne 0 ]]; then
|
||||
fi
|
||||
set -o errexit
|
||||
|
||||
"${OPENIM_ROOT}"/scripts/init-config.sh --skip
|
||||
|
||||
echo "You need to start the following scripts in order: ${OPENIM_SERVER_SCRIPTARIES[@]}"
|
||||
openim::log::install_errexit
|
||||
|
||||
# Function to execute the scripts.
|
||||
function execute_scripts() {
|
||||
for script_path in "${OPENIM_SERVER_SCRIPT_START_LIST[@]}"; do
|
||||
# Extract the script name without extension for argument generation.
|
||||
script_name_with_prefix=$(basename "$script_path" .sh)
|
||||
|
||||
# Remove the "openim-" prefix.
|
||||
script_name=${script_name_with_prefix#openim-}
|
||||
|
||||
# Construct the argument based on the script name.
|
||||
arg="openim::${script_name}::start"
|
||||
|
||||
# Check if the script file exists and is executable.
|
||||
if [[ -x "$script_path" ]]; then
|
||||
openim::log::status "Starting script: ${script_path##*/}" # Log the script name.
|
||||
|
||||
# Execute the script with the constructed argument.
|
||||
"$script_path" "$arg"
|
||||
|
||||
# Check if the script executed successfully.
|
||||
if [[ $? -eq 0 ]]; then
|
||||
openim::log::info "${script_path##*/} executed successfully."
|
||||
else
|
||||
openim::log::errexit "Error executing ${script_path##*/}."
|
||||
fi
|
||||
else
|
||||
openim::log::errexit "Script ${script_path##*/} is missing or not executable."
|
||||
fi
|
||||
done
|
||||
sleep 0.5
|
||||
for script_path in "${OPENIM_SERVER_SCRIPT_START_LIST[@]}"; do
|
||||
# Extract the script name without extension for argument generation.
|
||||
script_name_with_prefix=$(basename "$script_path" .sh)
|
||||
|
||||
# Remove the "openim-" prefix.
|
||||
script_name=${script_name_with_prefix#openim-}
|
||||
|
||||
# Construct the argument based on the script name.
|
||||
arg="openim::${script_name}::start"
|
||||
|
||||
# Check if the script file exists and is executable.
|
||||
if [[ -x "$script_path" ]]; then
|
||||
openim::log::status "Starting script: ${script_path##*/}" # Log the script name.
|
||||
|
||||
# Execute the script with the constructed argument.
|
||||
"$script_path" "$arg"
|
||||
|
||||
# Check if the script executed successfully.
|
||||
if [[ $? -eq 0 ]]; then
|
||||
openim::log::info "${script_path##*/} executed successfully."
|
||||
else
|
||||
openim::log::errexit "Error executing ${script_path##*/}."
|
||||
fi
|
||||
else
|
||||
openim::log::errexit "Script ${script_path##*/} is missing or not executable."
|
||||
fi
|
||||
done
|
||||
sleep 0.5
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user