tradle / rn-nodeify

hack to allow react-native projects to use node core modules, and npm modules that use them
MIT License
619 stars 112 forks source link

pkg-hacks.js now converts Windows path separators to POSIX, so that h… #36

Closed yairk closed 7 years ago

yairk commented 7 years ago

…acks run on Windows

mvayngrib commented 7 years ago

@yairk sorry for taking forever to respond. I don't have a Windows machine to test on, this doesn't break the path.resolve(file) a few lines below? Maybe we should cache the os-specific file path first, for later use in path.resolve and fs.readFile.

yairk commented 7 years ago

@mvayngrib This doesn't break subsequent operations (otherwise I wouldn't be able to use it on my Windows machine). Windows generally accepts both backslashes and forward slashes as path separators - unless the path is prefixed by \\?\ which will never happen in regular folder enumeration.

See some support for this at https://stackoverflow.com/questions/7314606/get-directory-separator-char-on-windows-etc and https://bytes.com/topic/python/answers/23123-when-did-windows-start-accepting-forward-slash-path-separator (unfortunately not an official source :-/ ).

mvayngrib commented 7 years ago

@yairk cool, thanks :)

yairk commented 7 years ago

Thanks. Can you please publish to npm as well?