Skip to content

fix: resolve symlinks in update.sh, tui.sh, restart.sh#360

Merged
xinhuagu merged 1 commit into
mainfrom
fix/update-resolve-symlink
Mar 28, 2026
Merged

fix: resolve symlinks in update.sh, tui.sh, restart.sh#360
xinhuagu merged 1 commit into
mainfrom
fix/update-resolve-symlink

Conversation

@xinhuagu

@xinhuagu xinhuagu commented Mar 28, 2026

Copy link
Copy Markdown
Owner

SCRIPT_DIR used dirname $0 which points to the symlink's directory (e.g. ~/bin), not the actual repo. Now follows the symlink chain with readlink before resolving dirname. Fixes aceclaw-update, aceclaw-tui, aceclaw-restart when invoked via symlink.

Summary by CodeRabbit

  • Bug Fixes
    • Improved symlink handling in build and utility scripts to ensure correct path resolution when scripts are invoked through symbolic links, enhancing reliability and consistency across different invocation methods.

SCRIPT_DIR used dirname of $0 which resolves to the symlink's
directory (e.g. ~/bin), not the repo. Now follows symlink chain
with readlink before resolving dirname.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@xinhuagu xinhuagu merged commit c5426d4 into main Mar 28, 2026
@xinhuagu xinhuagu deleted the fix/update-resolve-symlink branch March 28, 2026 19:13

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Mar 28, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 60cc7403-d8cb-43f3-a210-599cbf73a5fb

📥 Commits

Reviewing files that changed from the base of the PR and between c0c77b4 and 35aa7f2.

📒 Files selected for processing (3)
  • restart.sh
  • tui.sh
  • update.sh

📝 Walkthrough

Walkthrough

Three shell scripts (restart.sh, tui.sh, update.sh) have been modified to resolve symlinks when computing the script directory. Each script now follows symlink targets iteratively to locate the real script path before deriving SCRIPT_DIR, ensuring all subsequent commands use the actual script directory instead of a symlink directory.

Changes

Cohort / File(s) Summary
Symlink Resolution in Script Directory Detection
restart.sh, tui.sh, update.sh
Modified each script to resolve symlinks when computing SCRIPT_DIR. Replaces direct dirname "$0" logic with a loop using readlink to follow symlink targets (handling relative links) until reaching the final non-symlink path, then derives SCRIPT_DIR from that resolved location. All subsequent path-dependent commands now use the resolved real directory.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/update-resolve-symlink

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant