Skip to content

Instantly share code, notes, and snippets.

@ianscrivener
Forked from anonymous/mycode.js
Created February 7, 2014 11:33
Show Gist options
  • Save ianscrivener/8861133 to your computer and use it in GitHub Desktop.
Save ianscrivener/8861133 to your computer and use it in GitHub Desktop.
exec: {
//get IP & Set a local variable
get_ip: {
command: 'ifconfig | grep -m 1 "inet addr:192.168.1" | cut -c21-31',
callback: function (error, stdout, stderr) {
if (error !== null) {
grunt.log.error('exec error: ' + error);
};
globalConfig.myIP = stdout;
console.log('set myIP:', globalConfig.myIP);
},
stdout: false,
stderr: false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment