Skip to content

Commit

Permalink
重构
Browse files Browse the repository at this point in the history
  • Loading branch information
leizongmin committed Sep 18, 2015
1 parent d5e257c commit b3c2060
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lib/project_version.js
Expand Up @@ -72,13 +72,7 @@ ConfigBase.prototype.getProjectName = function () {
};


/**
* 从指定路径中加载配置
*/
function ConfigFromPath (superConfig, project, version) {
ConfigFromPath.super_.call(this, superConfig, project, version);

var ns = this.ns;
function simpleWrapNS (ns) {
var strictNS = function (a, b) {
if (arguments.length === 1) {
var ret = ns(a);
Expand All @@ -95,6 +89,17 @@ function ConfigFromPath (superConfig, project, version) {
strictNS.all = function () {
return ns();
};
return strictNS;
}


/**
* 从指定路径中加载配置
*/
function ConfigFromPath (superConfig, project, version) {
ConfigFromPath.super_.call(this, superConfig, project, version);

var strictNS = simpleWrapNS(this.ns);
strictNS.env = superConfig.getEnvConfig();

var files = superConfig._resolvePaths(project, version);
Expand Down

0 comments on commit b3c2060

Please sign in to comment.