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 error in safe_require when no unix #2

Closed
wants to merge 1 commit into from
Closed

fix error in safe_require when no unix #2

wants to merge 1 commit into from

Conversation

robertohuertasm
Copy link

I've been using this package with windows and was receiving errors when the safe_require function was executed, basically, due to a bad use of the separator.

@Klowner
Copy link
Owner

Klowner commented Sep 6, 2016

Thanks for the PR!

It looks to me like this may also potentially be an issue in upstream casual as well, since most of your modified lines are present there as well.

            providers.forEach(function(provider) {
                casual.register_provider(helpers.extend(
                    require('./providers/' + provider),
                    safe_require(__dirname + '/providers/' + locale + '/' + provider)
                ));
            });

If you could test regular casual on windows to verify, then submit a PR to boo1ean/casual, I'll be sure to merge it back to casual-browserify and regenerate the script.

@robertohuertasm
Copy link
Author

@Klowner you're very welcome!

The thing is that what they do inside the safe_require function is cross-os safe. I mean, they are using the existsSync from fs. But what you do is parsing the path. I've tested both libraries and yours is the only one giving this issues. That's why I decided to create the PR. 😉

@Klowner
Copy link
Owner

Klowner commented Sep 6, 2016

@robertohuertasm ohh, I see.

If your javascript bundling system supports regular casual then that's usually the best way to go, assuming you're able to load languages successfully.

Could I trouble you to test this branch and see if it works on your Windows environment? https://github.com/Klowner/casual-browserify/tree/browserify-nonunix

@robertohuertasm
Copy link
Author

robertohuertasm commented Sep 6, 2016

hey @Klowner, I've just tested and it seems to work too. 👍
Feel free to close this once you merge your other branch.

@Klowner
Copy link
Owner

Klowner commented Sep 6, 2016

Awesome, thanks again.

Fix is published as casual-browserify@1.5.4-pre.0

@Klowner Klowner closed this Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants