Is there an easy way to set up a grunt task so that I can push specific pages back to the server?
I’d like to do something like this:
grunt.initConfig({ 'skuid-push':{ 'options': orgOptions,<br> 'production':{<br> 'files':{<br> src: ['skuidpages/Optimize*', 'skuidpages/Cleanup*']<br> }<br> }<br> 'specific':{<br> 'files':{<br> src: ['skuidpages/'<b> + n</b>]<br> }<br> }<br> } });
grunt.registerTask('push-specific-page', ['skuid-push:specific']);
And then run something like this in the console:
grunt skuid-push:specific("Module1_PageName");
But it’s not clear to me if there’s actually a way to do that without hard-coding the page into the gruntfile each time. Any pointers on this?
Matt - Take a look at grunt.option (http://gruntjs.com/api/grunt.option). I think this should give you what you are looking for.
Matt,
Barry is correct. grunt.option would be your best bet. You’re snippet above wouldn’t have change much at all.
grunt.initConfig({
'skuid-push':{'options': orgOptions,<br> 'production':{<br> 'files':{<br> src: ['skuidpages/Optimize*', 'skuidpages/Cleanup*']<br> }<br> }<br> 'specific':{<br> 'files':{<br> src: ['skuidpages/'<b> + grunt.option('page')</b>]<br> }<br> }<br> } });
This will give you the ability to push any single or number of pages that you specify at runtime. The command would look something like this:
grunt skuid-push:specific --page="Module_SomeSinglePage.xml"
or
grunt skuid-push:specific --page="AllPagesInModule_*"
Janet
5
Matt, is it possible to set up a grunt task to pull down page by page?
Not that I’m aware of. @Ethan?