Permalink
Browse files

Issue #19296 Cleanup options config loader.

  • Loading branch information...
bendiy committed Mar 28, 2013
1 parent 45260fd commit 27e28893ee98b843b0b8c1f68d430966cb9add44
Showing with 14 additions and 9 deletions.
  1. +14 −9 node-datasource/lib/options.js
View
23 node-datasource/lib/options.js 100644 → 100755
@@ -4,19 +4,24 @@ regexp:true, undef:true, strict:true, trailing:true, white:true */
(function () {
"use strict";
-
- var _path = require("path"), flag, cwd, path;
-
+
+ var _path = require("path"),
+ flag,
+ cwd,
+ path;
+
cwd = process.cwd();
-
+
if ((flag = process.argv.indexOf("-c")) > 0) {
var configPath = process.argv[flag + 1];
- if (configPath[0] == '/') {
- path = configPath;
+ if (configPath[0] === '/') {
+ path = configPath;
} else {
- path = _path.join(cwd, process.argv[flag + 1]);
+ path = _path.join(cwd, process.argv[flag + 1]);
}
- } else { path = _path.join(cwd, "config.js"); }
-
+ } else {
+ path = _path.join(cwd, "config.js");
+ }
+
module.exports = require(path);
}());

0 comments on commit 27e2889

Please sign in to comment.