Automatically elevate your grunt script's UAC privileges in windows.
Install
$ npm install --save grunt-elevator
Usage
// tasks/elevate.jsmodule { grunt env: //We need to copy these variables to the elevated process. names: "HOME" "PATH" "SSH_AUTH_SOCK" "SSH_AGENT_PID" tmp: "c:\\temp\\elevatedEnv.tmp" // optional - defaults to working directory { if name == "HOME" && processenvHOMESHARE //We substitute HOME with HOMESHARE as the elevated process cannot access U:\ return processenvHOMESHARE; else if name == "SSH_AUTH_SOCK" || name == "SSH_AGENT_PID" && !value //If the ssh-agent is not running then issue a warning. gruntlog; } triggers: /activate/ /deactivate/ /* Set this to true if you need to get grunt-elevator working with grunt extensions that hook into grunt.log.header e.g. grunt-timer. Otherwise leave it false or unset (the default) */ writeHeader: true ;};
License
MIT © Ciaran Jessup