diff --git a/lib/server/main.js b/lib/server/main.js index 0fc07a38f69..6110a396adc 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -31,18 +31,19 @@ var http = require('http') , conditionallyPreLaunch = helpers.conditionallyPreLaunch , noColorLogger = helpers.noColorLogger; -if (require.main === module && args.showConfig) { - try { - var config = fs.readFileSync(configFile); - console.log(config.toString('utf8')); - process.exit(0); - } catch (e) { - console.error("Error: Appium is not correctly configured"); - process.exit(1); +var main = function(args, readyCb, doneCb) { + + if (args.showConfig) { + try { + var config = fs.readFileSync(configFile); + console.log(config.toString('utf8')); + process.exit(0); + } catch (e) { + console.error("Error: Appium is not correctly configured"); + process.exit(1); + } } -} -var main = function(args, readyCb, doneCb) { checkArgs(args); if (typeof doneCb === "undefined") { doneCb = function() {};