Fix: resolve symlinks when computing FLEET_ROOT (closes #3)#4
Merged
Merged
Conversation
bin/fleet computed FLEET_ROOT from ${BASH_SOURCE[0]} directly. When the
script was invoked through the ~/.local/bin/fleet symlink that
`fleet init` creates, dirname/.. resolved to the symlink's parent
(~/.local) instead of the install root, breaking all subsequent
`source "$FLEET_ROOT/lib/..."` loads.
Wrap ${BASH_SOURCE[0]} in realpath so the symlink is resolved before
parent computation. realpath is already used at bin/fleet:17.
Fixes oguzhnatly#3.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
oguzhnatly
approved these changes
Apr 29, 2026
Owner
oguzhnatly
left a comment
There was a problem hiding this comment.
Checked against issue #3. This fixes the exact failure mode with the smallest possible change. Resolving ${BASH_SOURCE[0]} through realpath before computing FLEET_ROOT is the right move here, and realpath is already used elsewhere in this entrypoint, so this does not add a new portability assumption. Approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bin/fleet:25computedFLEET_ROOTfrom${BASH_SOURCE[0]}directly. When the script was invoked through the~/.local/bin/fleetsymlink thatfleet initcreates as documented in_meta.jsonand the README,dirname/..resolved to the symlink's parent (~/.local) instead of the install root. Every subsequentsource "$FLEET_ROOT/lib/..."then failed withNo such file or directory, leaving the CLI unusable from PATH after a vanilla install.This change wraps
${BASH_SOURCE[0]}inrealpath, which is already used atbin/fleet:17for the same kind of resolution.Test plan
git clone … ~/.local/share/fleet && ~/.local/share/fleet/bin/fleet init && fleet --versionfails withlib/core/config.sh: No such file or directoryfleet --versioncorrectly printsfleet v3.0.4,fleet agentsruns, allsourcelines resolveFixes #3.