-
Notifications
You must be signed in to change notification settings - Fork 6
(hopeful) fix for #2 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
I added a test, and it looks like it's working. |
|
Thanks for submitting this fix, I'm in the process of testing it. |
|
I just realized your README says you explicitly avoid using |
|
I had completely forgotten about not wanting a |
|
I believe that |
|
That will only work for directories, not files, right? If I have a symlink
file at /foo/bar/baz.txt that points to /something/totally/different.txt,
and I want `pwd -P` to tell me where it points, I need to set my working
directory to /foo/bar/baz.txt.
Is that possible, since baz.txt is not a directory?
…On Sun, Sep 15, 2019, 1:46 PM Morgan Aldridge ***@***.***> wrote:
I believe that pwd -P might allow us to work around the readlink
requirement.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3?email_source=notifications&email_token=AAC35OEKKPFXTYRFTBVGJELQJZYIXA5CNFSM4IUK55MKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6XVRYI#issuecomment-531585249>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC35OG4T5YV4ESKSHB2TUTQJZYIXANCNFSM4IUK55MA>
.
|
|
@cspotcode Good point, I think that |
|
Honestly, I'm not fully a fan of the If you want to merge the updated tests into your branch I'll merge this. Huge thanks for catching this glaring bug and fixing it! |
|
Thanks for taking a look! The while-continue was laziness on my part; it
was the first implementation I thought of.
I'm on vacation till Monday but can merge Monday evening.
…On Sat, Sep 28, 2019, 2:01 PM Morgan Aldridge ***@***.***> wrote:
Honestly, I'm not fully a fan of the while/continue, but it works and is
pretty minimal. It passes the new tests, which is good.
If you want to merge the updated tests into your branch I'll merge this.
Huge thanks for catching this glaring bug and fixing it!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3?email_source=notifications&email_token=AAC35OAS4CMAXOSBLV2SQJTQL6LYRA5CNFSM4IUK55MKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD727BOI#issuecomment-536211641>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC35OFR34GXID3S4HU6C2LQL6LYRANCNFSM4IUK55MA>
.
|
I have only informally tested this locally, so I can't prove it works, and I haven't had time to write tests.
Idea is pretty simple: use
[[ -Lto check if final path is to a symlink. Usereadlinkto read it, concatenate the path back together, and try the entire thing all over again using the newly computed path.#2