-
Notifications
You must be signed in to change notification settings - Fork 2
synced version #1
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
Comments
hey did you know that grunt can be asynchronous? |
Thanks for your quick response. |
Okay, I thought you meant grunt task. I would not prefer refactoring it to a synchronous version because the error handling had to be with exceptions then. Maybe there is a better solution for you with using an asynchronous task to manage the requirejs config. What are you trying to accomplish? |
My gruntfile contains different tasks which build i18n files, css files, fonts and so on. So if you don't require moduleX/moduleX.js it would not include moduleX/moduleX.css |
okay I see. you can use grunt.registerTask('dynamic-task', function() {
var done = this.async();
// use requirejs reading here
configFile.read(function(err, config) {
// var myDynamicConfig ...
grunt.config.set('mytask.mytarget', myDynamicConfig);
grunt.task.run('cucumberjs:run');
done();
});
}); or maybe as a last resort there a libraries that convert async calls into sync calls :) |
My idea was not to replace the asynchronous part but to add an additional synced version which uses fs.readSync instead of fs.read I guess you would have to do some rewrites as you put it all in one big function instead of splitting it up into parts. After all it was just a feature request - if you are not up to it that's okay. |
+1 for the sync api. I'm using this lib within a node tool that has no need to be async. In fact, it would be cleaner and more efficient for a sync api. |
okay guys, got me convinced. |
i admit that changing the code to sync the tests become more clear as well. So thank you for the feedback. Please test it in production and give me feedback. |
Looks good! Loving it. Thanks, On Tue, Jul 22, 2014 at 5:49 AM, Philipp Scheit [email protected]
|
Hi,
I would like to use your file inside grunt however this would have to be synchronous.
Could you please provide a version which uses fs.readFileSync ?
The text was updated successfully, but these errors were encountered: