Grunt task to save command output to file.
$ npm install grunt-redirect
grunt --version>= 0.4
Type: Boolean
Default value: true
Set options.stdout to true to save stdout.
Type: Boolean
Default value: false
Set options.stderr to true to save stderr.
Type: Boolean
Default value: true
Set options.overwrite to true to overwrite output files.
redirect is a multitask, so you can use it similary to dist, build or etc...
grunt.initConfig({
...
redirect: {
dist: {
options: {
stdout: true,
stderr: false,
overwrite: true
},
files: {
"path/to/file01": "command01 arg1 arg2 ...",
"path/to/file02": "command02 arg1 arg2 ...",
...
}
}
}
...
});For example, bump version when you build your app.
grunt.initConfig({
...
redirect: {
build: {
files: {
"path/to/package.json": "command package.template data.json",
"path/to/bower.json": "command bower.template data.json",
"path/to/manifest.json": "command manifest.template data.json",
...
}
}
}
...
});MIT License (c) Hiroyuki Sano

