Running a command in a Grunt Task

后端 未结 6 1990
借酒劲吻你
借酒劲吻你 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:16

    Check out grunt.util.spawn:

    grunt.util.spawn({
      cmd: 'rm',
      args: ['-rf', '/tmp'],
    }, function done() {
      grunt.log.ok('/tmp deleted');
    });
    

提交回复
热议问题