From 4b7696ee765cd22d915510387009cbe3ae5fcdcf Mon Sep 17 00:00:00 2001 From: Dan Cuellar Date: Sat, 21 Sep 2013 13:12:23 -0700 Subject: [PATCH] Fixes from code review on #1161 --- app/ios.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/ios.js b/app/ios.js index 054c2e360..e375d2af1 100644 --- a/app/ios.js +++ b/app/ios.js @@ -317,20 +317,22 @@ IOS.prototype.onInstrumentsExit = function(code, traceDir, launchCb) { }; IOS.prototype.detectUdid = function (cb) { - if (this.udid !== null && this.udid == "auto") { + if (this.udid !== null && this.udid === "auto") { logger.info("Auto-detecting iOS udid..."); var udidetectPath = path.resolve(__dirname, "../build/udidetect/udidetect"); var udiddetectProc = exec(udidetectPath, { maxBuffer: 524288, timeout: 3000 }, function(err, stdout) { if (stdout && stdout.length > 2) { this.udid = stdout.replace("\n",""); logger.info("Detected udid as " + this.udid); + cb(); } else { logger.error("Could not detect udid."); + cb(new Error("Could not detect udid.")); } - cb(); }.bind(this)); udiddetectProc.on('timeout', function () { logger.error("Timed out trying to detect udid."); + cb(new Error("Timed out trying to detect udid.")); }); } else { cb();