fis-command-release
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -28,3 +28,3 @@ /* | ||
function normilize(str){ | ||
return '/' + str.replace(/^\//, ''); | ||
return '/' + String(str || '').replace(/^\//, ''); | ||
} | ||
@@ -37,19 +37,12 @@ | ||
dest.split(/,/g).forEach(function(d){ | ||
var opt = { md5 : md5 }; | ||
if(settings[d]){ | ||
var setting = settings[d]; | ||
if(setting.to){ | ||
opt.root = root; | ||
opt.from = normilize(setting.from || ''); | ||
opt.to = normilize(opt.to); | ||
} else { | ||
fis.log.error('invalid deploy config [deploy.' + d + '.to]'); | ||
} | ||
var opt = settings[d] || {}; | ||
opt.md5 = md5; | ||
opt.root = opt.root || root; | ||
opt.from = normilize(opt.from); | ||
if(opt.to){ | ||
opt.to = normilize(opt.to); | ||
} else if(/^output\b/.test(d)){ //local | ||
opt.root = root; | ||
opt.from = '/'; | ||
opt.to = normilize(d); | ||
} else if(d === 'preview'){ | ||
opt.root = fis.project.getTempPath('www'); | ||
opt.from = '/'; | ||
opt.to = '/'; | ||
@@ -56,0 +49,0 @@ } else { |
{ | ||
"name" : "fis-command-release", | ||
"description" : "fis release command.", | ||
"version" : "0.1.1", | ||
"version" : "0.1.2", | ||
"author" : "FIS Team <fis@baidu.com>", | ||
@@ -6,0 +6,0 @@ "homepage" : "http://fis.baidu.com/", |
7400
183