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 into it.
To clarify, I'm trying to use Closure Templates and "the task" should call the jar file to pre-compile the Soy file to a javascript file.
I'm running this jar from command line, but I want to set it as a task.
Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting. It uses a command-line interface to run custom tasks defined in a file (known as a Gruntfile). Grunt was created by Ben Alman and is written in Node.
grunt.task.existsCheck with the name, if a task exists in the registered tasks.
Alternatively you could load in grunt plugins to help this:
grunt-shell example:
shell: { make_directory: { command: 'mkdir test' } }
or grunt-exec example:
exec: { remove_logs: { command: 'rm -f *.log' }, list_files: { command: 'ls -l **', stdout: true }, echo_grunt_version: { command: function(grunt) { return 'echo ' + grunt.version; }, stdout: true } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With