Running a command in a Grunt Task

后端 未结 6 2002
借酒劲吻你
借酒劲吻你 2020-12-02 07:43

I\'m using Grunt (task-based command line build tool for JavaScript projects) in my project. I\'ve created a custom tag and I am wondering if it is possible to run a command

6条回答
  •  一个人的身影
    2020-12-02 08:05

    Guys are pointing child_process, but try to use execSync to see output..

    grunt.registerTask('test', '', function () {
            var exec = require('child_process').execSync;
            var result = exec("phpunit -c phpunit.xml", { encoding: 'utf8' });
            grunt.log.writeln(result);
    });
    

提交回复
热议问题