Skip to content

Commit

Permalink
Merge pull request #179 from phase2/task/fix_grunt_serve
Browse files Browse the repository at this point in the history
Fixing error with 'grunt serve' scope of drush:serve.
  • Loading branch information
grayside committed Jun 23, 2015
2 parents a69fa2d + f290e61 commit 200fbda
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tasks/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ module.exports = function(grunt) {
* Define tasks to quickly get Drupal running.
*
* grunt serve
* Run Drupal via the PHP webserver and active watch tasks.
* Run Drupal via the PHP webserver and activate watch tasks.
* grunt serve:demo
* Run Drupal via the PHP webserver without running watch tasks.
* grunt serve:test
* Run Drupal via the PHP webserver without running watch tasks or opening the browser.
* Run Drupal via the PHP webserver without running watch tasks or opening
* the browser.
*/
grunt.loadNpmTasks('grunt-drush');

Expand All @@ -30,13 +31,14 @@ module.exports = function(grunt) {
}, cmd)
});

grunt.config(['drush', 'serve'], {
args: ['runserver', ':' + (grunt.config('serve.port') || 8080)],
options: _.extend({
cwd: '<%= config.buildPaths.html %>'
}, cmd)
});

grunt.registerTask('serve', 'Run Drupal using the PHP built-in webserver. serve:demo to run without watch tasks and serve:test for grunt-drupal-tasks development.', function() {
grunt.config(['drush', 'serve'], {
args: ['runserver', ':' + (grunt.config('serve.port') || 8080)],
options: _.extend({
cwd: '<%= config.buildPaths.html %>'
}, cmd)
});

if (this.args[0] != 'test') {
// Unlike the test version, this one allows port overriding and opens the site in a new tab.
Expand Down

0 comments on commit 200fbda

Please sign in to comment.