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 }}
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.
Following discussion on Reddit, I think it might be a good idea if dep checked the case of the names of its configuration files such as Gopkg.toml, at least on Mac.
This would prevent the problem of Mac users checking in a project with gopkg.toml in lower case, which works on the Mac (because it's case-insensitive) but fails on Linux.
The text was updated successfully, but these errors were encountered:
the key place to look will be in Ctx.LoadProject(). that's where the check will need to happen.
as for doing the check itself, you'll probably want to take inspiration from fs.isCaseSensitiveFilesystem(), though i'd prefer we do a bit of copying rather than exporting it directly, at least for now.
that should be enough to get you started - please let me know what other pointers would be helpful!
@sdboyer I took a look at the functions you pointed to. However, I think the problem here is slightly different. What I need to do is check if the Gopkg.toml exists with an incorrect case. Which can mean any of gopkg.toml, gopkg.TOML, GoPkg.toml etc. The simple way would be, ask for os.stat(ManifestName) and cross check the contents of stat.Name(). However, this simply returns the name we supplied for getting stats and not the actual file name:
However this is quite wasteful. Is there any better way to do this?
there is not, AFAIK. that's why i was loathe to recommend it, and just suggested the crappier approach of trying the one case variation. you're right, of course, that we have to try all the combinations if we actually want to truly enforce this as a rule.
the best i can offer is that you can at least avoid having to os.Stat()everything by doing case-insensitive comparison of each of the files in the list using strings.FoldEqual()
Following discussion on Reddit, I think it might be a good idea if
dep
checked the case of the names of its configuration files such asGopkg.toml
, at least on Mac.This would prevent the problem of Mac users checking in a project with
gopkg.toml
in lower case, which works on the Mac (because it's case-insensitive) but fails on Linux.The text was updated successfully, but these errors were encountered: