You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bash extractor: . "$(cd "$(dirname "$0")/.." && pwd)/lib/f.sh" (the script-dir idiom inline in source) gets no edge #5562
A script loads its library with the script-dir idiom written inline in the . (or source) line, with no variable:
."$(cd "$(dirname "$0")/.."&& pwd)/lib/greet.sh"
Graphify finds no file for it: no imports_from edge to lib/greet.sh, and no calls edge to the function the script then calls. #3416 listed a form of this (its f4, with ${BASH_SOURCE[0]} and no ..); the $0 and /.. form below still gives nothing.
Reproduced on graphifyy 0.9.122 (newest on PyPI), installed with pip, nothing patched, Python 3.12, Ubuntu.
imports_from bin/tool -> lib/greet.sh
calls bin/tool main -> lib/greet.sh greet
Got
calls bin/tool (script) -> bin/tool main
Cause and fix
The source branch strips a leading ${VAR} or $VAR, but not a leading $(cd "$(dirname "$0")/<rel>" && pwd).
Reading that idiom as the script's own folder plus <rel>, then the literal path after it, fixes it.
We carry this fix as a local patch and can open a PR.
Activity
github-actions commentedon Nov 28, 2026
Thanks for opening this issue, @yashsaxena. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
fix(bash): resolve the script-dir idiom written inline in source (#5562)