Hide "Run task X" in the grunt

I worked on setting up the project and deploying the Gruntfile, but would like to hide the command line output so that the following:

Running "init" task

Running "prompt:init" (prompt) task
[?] If you continue your project information will be overwritten.
    Continue? (Y/n)

becomes

[?] If you continue your project information will be overwritten.
    Continue? (Y/n)

when starting grunt. I know that this is only cosmetics, but this is what I would like to do and cannot find anything in the Grunt API documentation to indicate that this can be done.

+4
source share
1 answer

This is not currently supported, but is possible thanks to the following workaround (from shama to GitHub):

grunt.log.header = function () {};

, ( "running x task" ) , , , .

:

  • npm install grunt-log-headers, grunt-log-headers.
  • require('grunt-log-headers')(grunt); Gruntfile.js, .
  • , , :

    options: {
        gruntLogHeader: false
    }
    

    :

    grunt.initConfig({
        sometask: {
            options: {
                gruntLogHeader: false,
            }
        }
    });
    

, . 0.5.0.

+4

Source: https://habr.com/ru/post/1538070/


All Articles