Skip to content

fix: portability issues with git tooling and root.#3

Merged
1shooperman merged 1 commit into
mainfrom
fix/portability
May 28, 2026
Merged

fix: portability issues with git tooling and root.#3
1shooperman merged 1 commit into
mainfrom
fix/portability

Conversation

@1shooperman
Copy link
Copy Markdown
Owner

@1shooperman 1shooperman commented May 28, 2026

Timestamp

Thu May 28 12:48:07 EDT 2026

Summary

Fixes symlink resolution in gitprune and gitrefresh so they correctly locate lib/gitcmds.sh when invoked through a symlink (e.g. from a ~/bin or /usr/local/bin symlink).

Previously, BASH_SOURCE[0] resolved to the symlink path rather than the real file path, causing dirname to produce the wrong base directory and source to fail.

Why

Scripts installed via symlink are a common deployment pattern. The prior implementation broke silently in that setup — the source call would fail to find the library, making both tools non-functional outside a direct path invocation.

Notes for Reviewers

  • The fix follows the standard POSIX readlink loop pattern for resolving symlinks portably (no realpath dependency).
  • Change is limited to the two entry-point scripts; library code is untouched.

@1shooperman 1shooperman merged commit 92ed238 into main May 28, 2026
2 checks passed
@1shooperman 1shooperman deleted the fix/portability branch May 28, 2026 16:49
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