loosen up sudo check so it allows various forms of authorize

This commit is contained in:
Jonathan Lipps
2014-04-10 16:22:11 -07:00
parent daa7c2f216
commit 9cb4e207d5
+2 -1
View File
@@ -19,11 +19,12 @@ if (require.main === module) {
logger = logFactory.get('appium');
var appiumPermStat = fs.statSync(path.resolve(__dirname, '../../package.json'));
var launchCmd = (process.env.SUDO_COMMAND || "").toLowerCase();
if (
!isWindows &&
(!_(process.env.SUDO_UID).isUndefined() || appiumPermStat.uid !== process.getuid()) &&
!(process.env.SUDO_COMMAND || "").match(/grunt authorize/)
!launchCmd.match(/authorize/)
) {
logger.error("Appium will not work if used or installed with sudo. " +
"Please rerun/install as a non-root user. If you had to install " +