resolve symlinks before reading solution files#356
Conversation
|
I thought we were doing this already somewhere. However, from my understanding of #354, the issue was that the name of the file we were using to submit was the one of the original file rather than the one from the symlink. Does this correct that issue? |
|
Yeah, it looks like I misunderstood the original issue. Let me take another look at this. |
I can't.
Maybe? @Insti would you weigh in here, since you reported the original issue? I think we may have a gap in our understanding of the problem. |
|
The original issue was this: Original file name: The submitted file name is What @Insti was referring to is that he expected the argument passed to submit to be the name of the file rather than the file linked to. |
|
@Tonkpils has summarised the issue correctly. |
|
I suspect the problem is here: https://github.com/exercism/cli/blob/follow_symlinks/cmd/submit.go#L78-L85 The symlink is resolved, but the original name is not kept. Given that the new I don't currently have a Go development environment set up to check this myself. |
Ah, so we're EvalSymlink twice, once in |
3504fa2 to
223d6f4
Compare
Preserves filename of symlink rather than replacing filename with what the symlink links to. Fixes #354
223d6f4 to
732f9dc
Compare
|
Thanks @Insti I didn't even think to check that the outer loop would be resolving the symlinks. I've squashed the commits down to what really needed to happen. I didn't change any code in |
|
Great. I'm usually in favour of more tests, but is the test actually testing anything that is not already tested? (Other than if I'd rather see a test that detected the original bug(?) in (I really appreciate the work you're putting into this @lcowell ! ❤️) Edit:
This may be way easier said than done, given that it is a huge method with no existing tests. 😢 |
|
This is ready to be merged. |
Resolves symlinks before reading file contents in. This should be OS
independent as I'm using the filepath package to resolve the symlink.
Fixes #354