-
Notifications
You must be signed in to change notification settings - Fork 458
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
Detect windows using os.name
rather than line.separator
.
#639
Conversation
…orm is unreliable. Deprecate `LineEnding.nativeIsWin()`, and add `FileSignature.machineIsWin()`.
…machineIsWin()`. Notably, none of the usages actually cared about line endings, they only cared about paths and default system shells, which indicates that bundling this with `LineEnding` was probably always a bad idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work in any case and the performance penalty on *nix machines is probably neglegible. Even if you keep the check (probably a !machineIsUnix()
would be more clear, since that is essentially what is interesting here) you could keep the File.separatorChar
.
Co-authored-by: J-N-K <J-N-K@users.noreply.github.com>
Co-authored-by: J-N-K <J-N-K@users.noreply.github.com>
Ooh, I like the |
…ure we don't duplicate it.
There was a related bug, which was completely clobbering the git-native line endings anyway. Just fixed in previous commit. With these fixes combined, I think we have fixed the problem completely. |
Released in |
Added
FileSignature.machineIsWin
, which detects the OS usingos.name
, and replaces the now-deprecatedLineEnding.nativeIsWin
, which detected the OS usingline.separator
.