fis-command-release
Advanced tools
Comparing version 0.0.5 to 0.1.0
@@ -27,2 +27,6 @@ /* | ||
function normilize(str){ | ||
return '/' + str.replace(/^\//, ''); | ||
} | ||
module.exports = function(dest, md5, collection, fis){ | ||
@@ -33,15 +37,9 @@ var settings = fis.config.get('deploy', {}); | ||
dest.split(/,/g).forEach(function(d){ | ||
var opt = { md5 : md5 }; | ||
if(settings[d]){ | ||
var opt = settings[d]; | ||
if(opt.to){ | ||
var from = opt.from; | ||
if(from){ | ||
opt.from = '/' + from.replace(/^\//, ''); | ||
} else { | ||
opt.from = '/'; | ||
} | ||
var setting = settings[d]; | ||
if(setting.to){ | ||
opt.root = root; | ||
opt.to = '/' + opt.to.replace(/^\//, ''); | ||
opt.md5 = md5; | ||
dests.push(opt); | ||
opt.from = normilize(setting.from || ''); | ||
opt.to = normilize(opt.to); | ||
} else { | ||
@@ -51,11 +49,13 @@ fis.log.error('invalid deploy config [deploy.' + d + '.to]'); | ||
} else if(/^output\b/.test(d)){ //local | ||
dests.push({ | ||
md5 : md5, | ||
root : root, | ||
from : '/', | ||
to : '/' + d | ||
}); | ||
opt.root = root; | ||
opt.from = '/'; | ||
opt.to = normilize(d); | ||
} else if(d === 'preview'){ | ||
opt.root = fis.project.getTempPath('www'); | ||
opt.from = '/'; | ||
opt.to = '/'; | ||
} else { | ||
fis.log.error('invalid deploy destination options [' + d + ']'); | ||
} | ||
dests.push(opt); | ||
}); | ||
@@ -62,0 +62,0 @@ fis.util.map(collection, function(subpath, file){ |
{ | ||
"name" : "fis-command-release", | ||
"description" : "fis release command.", | ||
"version" : "0.0.5", | ||
"version" : "0.1.0", | ||
"author" : "FIS Team <fis@baidu.com>", | ||
@@ -6,0 +6,0 @@ "homepage" : "http://fis.baidu.com/", |
@@ -127,3 +127,3 @@ /* | ||
domain : options.domain | ||
}); | ||
}); | ||
@@ -130,0 +130,0 @@ if(options.watch){ |
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
7646
190