fis-command-release
Advanced tools
Comparing version 0.5.8 to 0.5.9
{ | ||
"name" : "fis-command-release", | ||
"description" : "fis release command.", | ||
"version" : "0.5.8", | ||
"version" : "0.5.9", | ||
"author" : "FIS Team <fis@baidu.com>", | ||
@@ -6,0 +6,0 @@ "homepage" : "http://fis.baidu.com/", |
@@ -95,5 +95,6 @@ /* | ||
.option('-d, --dest <names>', 'release output destination', String, 'preview') | ||
.option('-r, --root <path>', 'set project root') | ||
.option('-w, --watch', 'monitor the changes of project') | ||
.option('-c, --clean', 'clean compile cache', Boolean, false) | ||
.option('--md5 <level>', 'md5 release option', parseInt, 0) | ||
.option('-m, --md5 [level]', 'md5 release option', Number) | ||
.option('-D, --domains', 'add domain name', Boolean, false) | ||
@@ -111,18 +112,27 @@ .option('-L, --lint', 'with lint', Boolean, false) | ||
} | ||
//try to find fis-conf.js | ||
var root = fis.util.realpath(process.cwd()), | ||
cwd = root, | ||
filename = fis.project.conf, | ||
pos = cwd.length, conf; | ||
do { | ||
cwd = cwd.substring(0, pos); | ||
conf = cwd + '/' + filename; | ||
if(fis.util.exists(conf)){ | ||
root = cwd; | ||
break; | ||
var root; | ||
if(options.root){ | ||
root = fis.util.realpath(options.root); | ||
if(fis.util.isDir(root)){ | ||
delete options.root; | ||
} else { | ||
conf = false; | ||
pos = cwd.lastIndexOf('/'); | ||
fis.log.error('invalid project root path [' + options.root + ']'); | ||
} | ||
} while(pos > 0); | ||
} else{ | ||
//try to find fis-conf.js | ||
var cwd = root = fis.util.realpath(process.cwd()), | ||
filename = fis.project.conf, | ||
pos = cwd.length, conf; | ||
do { | ||
cwd = cwd.substring(0, pos); | ||
conf = cwd + '/' + filename; | ||
if(fis.util.exists(conf)){ | ||
root = cwd; | ||
break; | ||
} else { | ||
conf = false; | ||
pos = cwd.lastIndexOf('/'); | ||
} | ||
} while(pos > 0); | ||
} | ||
@@ -145,2 +155,13 @@ process.title = 'fis ' + process.argv.splice(2).join(' ') + ' [ ' + root + ' ]'; | ||
} | ||
switch (typeof options.md5){ | ||
case 'undefined': | ||
options.md5 = 0; | ||
break; | ||
case 'boolean': | ||
options.md5 = options.md5 ? 1 : 0; | ||
break; | ||
default : | ||
options.md5 = isNaN(options.md5) ? 0 : parseInt(options.md5); | ||
} | ||
//md5 > 0, force release hash file | ||
@@ -147,0 +168,0 @@ options.hash = options.md5 > 0; |
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
12449
247