#!/usr/bin/env iojs

var path = require('path'),
  program = require('commander'),
  fs = require('fs'),
  sequoria = require('sequoria'),
  createBot = require('./lib').createBot;

function main() {
  program
    .version(require('./package').version)
    .usage('[configFile]')
    .action(function(configFile){
      // this module is being directly run.
      var configFile = path.resolve(configFile || 'config.json');

      var config = JSON.parse(fs.readFileSync(configFile));
      var bot = createBot(config);
      bot.start();
    })
    .parse(process.argv);
}

if (require.main === module) {
  main();
}

module.exports = createBot;

#!/usr/bin/env iojs

var program = require('commander'),
  fs = require('fs'),
  sequoria = require('sequoria'),
  createBot = require('./lib').createBot;

function main() {
  program
    .version(require('./package').version)
    .usage('[configFile]')
    .action(function(configFile){
      // this module is being directly run.
      var configFile = configFile || 'config.json';
      if (!configFile.startsWith('/')) {
        // hack: should use proper path joining package
        configFile = [
          process.cwd(),
          configFile
        ].join('/');
      }

      var config = JSON.parse(fs.readFileSync(configFile));
      var bot = createBot(config);
      bot.start();
    })
    .parse(process.argv);
}

if (require.main === module) {
  main();
}

module.exports = createBot;

--- 
+++ 
@@ -1,6 +1,7 @@
 #!/usr/bin/env iojs
 
-var program = require('commander'),
+var path = require('path'),
+  program = require('commander'),
   fs = require('fs'),
   sequoria = require('sequoria'),
   createBot = require('./lib').createBot;
@@ -11,14 +12,7 @@
     .usage('[configFile]')
     .action(function(configFile){
       // this module is being directly run.
-      var configFile = configFile || 'config.json';
-      if (!configFile.startsWith('/')) {
-        // hack: should use proper path joining package
-        configFile = [
-          process.cwd(),
-          configFile
-        ].join('/');
-      }
+      var configFile = path.resolve(configFile || 'config.json');
 
       var config = JSON.parse(fs.readFileSync(configFile));
       var bot = createBot(config);
Use path.resolve to resolve path
