Skip to content

Fix resolving PGMODELER_ROOT from pgmodeler.vars#1193

Open
rokkie wants to merge 1 commit intonullptrlabs:developfrom
rokkie:envvars-path-fix
Open

Fix resolving PGMODELER_ROOT from pgmodeler.vars#1193
rokkie wants to merge 1 commit intonullptrlabs:developfrom
rokkie:envvars-path-fix

Conversation

@rokkie
Copy link
Contributor

@rokkie rokkie commented Oct 28, 2018

When pgmodeler.vars is source'd the $0 variable expands to '-bash'
which causes readlink to fail and PGMODELER_ROOT being set to the wrong
directory.
This is fixed by using a while loop that recursively changes directory
following symlinks along the way util it reaches the end and then reads
the current working directory.
For more info, see:
https://gist.github.com/TheMengzor/968e5ea87e99d9c41782

When pgmodeler.vars is source'd the $0 variable expands to '-bash'
which causes readlink to fail and PGMODELER_ROOT being set to the wrong
directory.
This is fixed by using a while loop that recursively changes directory
following symlinks along the way util it reaches the end and then reads
the current working directory.
For more info, see:
https://gist.github.com/TheMengzor/968e5ea87e99d9c41782
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