Skip to content

fix: resolve multiple critical bugs in start.sh (#36)#46

Merged
SonicBotMan merged 2 commits into
mainfrom
fix/issue-36-start-sh-bugs
Mar 15, 2026
Merged

fix: resolve multiple critical bugs in start.sh (#36)#46
SonicBotMan merged 2 commits into
mainfrom
fix/issue-36-start-sh-bugs

Conversation

@SonicBotMan

Copy link
Copy Markdown
Owner

🐛 Bug Fixes

Fixes #36

Critical Bugs Fixed

🔴 Bug 1: SCRIPT_DIR Undefined

  • Problem: $SCRIPT_DIR variable was never defined
  • Impact: Current directory detection completely failed
  • Fix: Added SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" at script start

🔴 Bug 2: HOME Environment Pollution

  • Problem: export HOME="$TEMP_DIR" polluted user terminal
  • Impact: All terminal commands affected after running start.sh
  • Fix: Use OPENCLAW_CONFIG_DIR instead of modifying HOME

🟠 Bug 3: Git Installation Only Supported apt-get

  • Problem: Only Ubuntu/Debian supported
  • Impact: macOS, Fedora, Arch users would get errors
  • Fix: Multi-platform support (apt-get, yum, brew) + graceful failure

🟠 Bug 4: set -e and || true Mixing

  • Problem: Error handling was unreliable
  • Impact: Unexpected script behavior
  • Fix: Removed set -e, use manual error checking

Improvements

  • Corrected gateway port (3000 → 18789)
  • Better error messages for troubleshooting
  • Graceful degradation when Git install fails

Testing

  • Test on Linux with USB detection
  • Test on macOS with USB detection
  • Test from current directory
  • Test without Git installed

Priority

🔴 P0 Critical - Script was completely broken for current directory usage


This PR was created automatically by AI assistant

SonicBotMan added 2 commits March 15, 2026 05:17
- Remove all Chinese characters from start.bat
- Convert to pure English for better compatibility
- Add .gitattributes to enforce correct line endings
- Add .editorconfig to prevent future encoding issues

Fixes #44
Related #37
Bug Fixes:
- Fix SCRIPT_DIR undefined variable (critical)
- Remove export HOME pollution
- Add multi-platform Git installation support
- Remove set -e, use manual error handling
- Use rsync for incremental sync

Improvements:
- Correct gateway port (3000 -> 18789)
- Graceful failure when Git install fails
- Better error messages

Fixes #36
@SonicBotMan SonicBotMan merged commit a8f55fd into main Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG修复] start.sh 存在多个严重Bug,需要紧急修复

1 participant