fis-command-install
Advanced tools
Comparing version 0.1.26 to 0.1.27
@@ -294,2 +294,31 @@ var Promise = require('bluebird'); | ||
} | ||
if (config.main && config.mapping && Array.isArray(config.mapping)) { | ||
var src = config.main; | ||
var dst = ''; | ||
src[0] !== '/' && (src = '/' + src); | ||
config.mapping.every(function(obj) { | ||
var m = obj.reg.exec(src); | ||
if (m && obj.release) { | ||
dst = obj.release.replace(/\$([\d&]+)/g, function(_, key) { | ||
return m[key === '&' ? '0' : key] || ''; | ||
}); | ||
return false; | ||
} | ||
}); | ||
if (dst) { | ||
dst[0] === '/' && (dst = dst.substring(1)); | ||
config.main = dst; | ||
} | ||
} | ||
var configCopy = _.mixin({}, config); | ||
delete configCopy.shim; | ||
delete configCopy.mapping; | ||
write(path.join(location, 'component.json'), JSON.stringify(configCopy, null, 2)); | ||
} | ||
@@ -296,0 +325,0 @@ } |
{ | ||
"name": "fis-command-install", | ||
"description": "fis install command.", | ||
"version": "0.1.26", | ||
"version": "0.1.27", | ||
"author": "FIS Team <fis@baidu.com>", | ||
@@ -6,0 +6,0 @@ "homepage": "http://fis.baidu.com/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50345
1180