Improve: Add symlink for consistent ferrumpy-current.data path duri…#3
Improve: Add symlink for consistent ferrumpy-current.data path duri…#3zavakid wants to merge 1 commit intoxiaoniaoyouhuajiang:mainfrom
ferrumpy-current.data path duri…#3Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70f01bf53c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| WORKER_PATH="" | ||
| DATA_DIR="$INSTALL_DIR/ferrumpy-${VERSION}.data/scripts" | ||
| if [ -d "$DATA_DIR" ] && [ -f "$DATA_DIR/ferrumpy-repl-worker" ]; then | ||
| ln -s -r "$INSTALL_DIR/ferrumpy-${VERSION}.data" "$INSTALL_DIR/ferrumpy-current.data" |
There was a problem hiding this comment.
Make symlink creation idempotent
Because the script uses set -e, this ln -s -r will abort the installer if ferrumpy-current.data already exists (e.g., re-running the installer after a previous version), which is exactly the update scenario described in the commit message. This makes upgrades fail instead of updating the symlink. Consider removing the existing link first or using ln -sf (and handling the case where a real directory already exists) so repeated installs succeed.
Useful? React with 👍 / 👎.
When I install a new version, my
.zshrcalways fails to update to the latest version, so I hope to update the version path to a fixed path, which would make it easier when installing a new version.