Skip to content
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

Fix #19 #22

Closed
wants to merge 2 commits into from
Closed

Fix #19 #22

wants to merge 2 commits into from

Conversation

timotree3
Copy link

This pull request fixes #19 in a way consistent with the current code.

I think the issue was caused by the fact that the gx.GetPackageRoot() function uses os.Getwd() but doesn't evaluate symlinks.
The desired behaviour as illustrated by the top-level cwd variable is to evaluate symlinks after using os.Getwd().

This pull request makes this behaviour consistent by evaluating symlinks in gx.GetPackageRoot()'s output.

`gx.GetPackageRoot()` uses `os.Getwd()`, but unlike the cwd variable,
it doesn't use `filepath.EvalSymlinks`.

Now it's output is fed to `filepath.EvalSymlinks` to fix the problem
occuring in whyrusleeping#19.
main.go Outdated
if err != nil {
return err
}
lroot, err := filepath.EvalSymlinks(lroot)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you mean to use mroot here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I do. I will update the PR.

@whyrusleeping
Copy link
Owner

@lgierth mind reviewing this? I don't use symlinks in my workflow at all

@whyrusleeping
Copy link
Owner

Fixed in #26

@timotree3 timotree3 closed this Oct 21, 2019
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.

Rewrites broken in symlinked directories
2 participants