I currently use grunt-shell to run shell commands from a grunt task. Is there a better way to run multiple commands in one task other than stringing them together with '&&'?
My Gruntfile (partial):
grunt.initConfig({
shell: {
deploy: {
options: { stdout: true },
command: 'mkdir -p static/styles && cp public/styles/main.css static/styles'
}
}
});
An array of commands doesn't work, but it would be nice:
grunt.initConfig({
shell: {
deploy: {
options: { stdout: true },
command: [
'mkdir -p static/styles',
'cp public/styles/main.css static/styles'
]
}
}
});
You can join them together:
grunt.initConfig({
shell: {
deploy: {
options: { stdout: true },
command: [
'mkdir -p static/styles',
'cp public/styles/main.css static/styles'
].join('&&')
}
}
});
The reason I chose not to support arrays is that some might want ;
as the separator instead of &&
, which makes it easier to do the above.
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