Browse Source

fix: Correct syntax error in install.sh

- Fixed a syntax error in the `check_requirements` function by replacing the incorrect closing brace with `fi`.
- This change ensures proper script execution and improves error handling for user permissions.

This commit addresses a critical issue in the installation script to enhance reliability.
pull/20/head
Xx 6 months ago
parent
commit
61392768a9
  1. 8
      analysis
  2. 2
      install.sh

8
analysis

@ -0,0 +1,8 @@
1. 问题定位
- 错误发生在第68行附近的 `}` 处
- 这是一个 shell 脚本语法错误
- 检查发现是 check_requirements 函数中的花括号闭合问题
2. 解决方案
- 移除多余的花括号
- 确保函数语法正确

2
install.sh

@ -65,7 +65,7 @@ check_requirements() {
if [ ! -w "$INSTALL_DIR" ]; then if [ ! -w "$INSTALL_DIR" ]; then
error "No write permission for $INSTALL_DIR. Please run with sudo." \ error "No write permission for $INSTALL_DIR. Please run with sudo." \
"没有 $INSTALL_DIR 的写入权限。请使用 sudo 运行此脚本。" "没有 $INSTALL_DIR 的写入权限。请使用 sudo 运行此脚本。"
}
fi
} }
# Verify binary / 验证二进制文件 # Verify binary / 验证二进制文件

Loading…
Cancel
Save