I have a Gruntfile which I intend to use on both OS X and Linux (Ubuntu, to be precise). I have some logic wrapped up inside a grunt-shell task:
shell: {
somejob_linux: {
command: [
'firstlinuxcommand',
'secondlinuxcommand'
]
},
somejob_osx: {
command: [
'firstosxcommand',
'secondosxcommand'
]
}
}
I'd like to have the first target (somejob_linux
) executed if the Gruntfile is being run on Linux, and somejob_osx
for OS X.
Is there an elegant way for me to achieve this? Or is there another alternative for having different commands or Grunt task/targets run for each platform? I'd prefer to keep everything within the Gruntfile, rather than calling out to external scripts simply for this purpose.